Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Syndication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
Syndication
Commits
5c290fcc
Commit
5c290fcc
authored
12 years ago
by
Prasath Nadarajah
Browse files
Options
Downloads
Patches
Plain Diff
default post type and post status
parent
c32b62c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/class-wp-rss-client.php
+19
-8
19 additions, 8 deletions
includes/class-wp-rss-client.php
with
19 additions
and
8 deletions
includes/class-wp-rss-client.php
+
19
−
8
View file @
5c290fcc
...
...
@@ -5,13 +5,22 @@ include_once( dirname(__FILE__) . '/interface-wp-client.php' );
class
WP_RSS_Client
extends
SimplePie
implements
WP_Client
{
private
$default_post_type
;
private
$default_post_status
;
private
$response
;
private
$error_message
;
private
$error_code
;
function
__construct
(
$site_ID
)
{
parent
::
SimplePie
();
$this
->
set_feed_url
(
get_post_meta
(
$site_ID
,
'syn_feed_url'
,
true
)
);
$this
->
default_post_type
=
get_post_meta
(
$site_ID
,
'syn_default_post_type'
,
true
);
$this
->
default_post_status
=
get_post_meta
(
$site_ID
,
'syn_default_post_status'
,
true
);
}
public
function
new_post
(
$post_ID
)
{
...
...
@@ -59,8 +68,8 @@ class WP_RSS_Client extends SimplePie implements WP_Client{
public
static
function
display_settings
(
$site
)
{
$feed_url
=
get_post_meta
(
$site
->
ID
,
'syn_feed_url'
,
true
);
$selected_post_type
=
get_post_meta
(
$site
->
ID
,
'syn_
selected
_post_type'
,
true
);
$selected_post_status
=
get_post_meta
(
$site
->
ID
,
'syn_
selected
_post_status'
,
true
);
$selected_post_type
=
get_post_meta
(
$site
->
ID
,
'syn_
default
_post_type'
,
true
);
$selected_post_status
=
get_post_meta
(
$site
->
ID
,
'syn_
default
_post_status'
,
true
);
?>
...
...
@@ -71,10 +80,10 @@ class WP_RSS_Client extends SimplePie implements WP_Client{
<input
type=
"text"
name=
"feed_url"
id=
"feed_url"
size=
"100"
value=
"
<?php
echo
esc_attr
(
$feed_url
);
?>
"
/>
</p>
<p>
<label
for=
"
selected
_post_type"
>
<?php
echo
esc_html__
(
'Select post type'
,
'push-syndication'
);
?>
</label>
<label
for=
"
default
_post_type"
>
<?php
echo
esc_html__
(
'Select post type'
,
'push-syndication'
);
?>
</label>
</p>
<p>
<select
name=
"
selected
_post_type"
id=
"
selected
_post_type"
/>
<select
name=
"
default
_post_type"
id=
"
default
_post_type"
/>
<?php
...
...
@@ -89,10 +98,10 @@ class WP_RSS_Client extends SimplePie implements WP_Client{
</select>
</p>
<p>
<label
for=
"
selected
_post_status"
>
<?php
echo
esc_html__
(
'Select post status'
,
'push-syndication'
);
?>
</label>
<label
for=
"
default
_post_status"
>
<?php
echo
esc_html__
(
'Select post status'
,
'push-syndication'
);
?>
</label>
</p>
<p>
<select
name=
"
selected
_post_status"
id=
"
selected
_post_status"
/>
<select
name=
"
default
_post_status"
id=
"
default
_post_status"
/>
<?php
...
...
@@ -114,8 +123,8 @@ class WP_RSS_Client extends SimplePie implements WP_Client{
public
static
function
save_settings
(
$site_ID
)
{
update_post_meta
(
$site_ID
,
'syn_feed_url'
,
esc_url_raw
(
$_POST
[
'feed_url'
]
)
);
update_post_meta
(
$site_ID
,
'syn_
selected
_post_type'
,
$_POST
[
'
selected
_post_type'
]
);
update_post_meta
(
$site_ID
,
'syn_
selected
_post_status'
,
$_POST
[
'
selected
_post_status'
]
);
update_post_meta
(
$site_ID
,
'syn_
default
_post_type'
,
$_POST
[
'
default
_post_type'
]
);
update_post_meta
(
$site_ID
,
'syn_
default
_post_status'
,
$_POST
[
'
default
_post_status'
]
);
return
true
;
}
...
...
@@ -136,6 +145,8 @@ class WP_RSS_Client extends SimplePie implements WP_Client{
$posts
[]
=
array
(
'post_title'
=>
$item
->
get_title
(),
'post_content'
=>
$item
->
get_description
(),
'post_type'
=>
$this
->
default_post_type
,
'post_status'
=>
$this
->
default_post_status
,
'post_date'
=>
$item
->
get_date
()
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment