Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
82d667e2
Commit
82d667e2
authored
Feb 21, 2017
by
Erick Hitter
Browse files
Restore Jetpack Sync for CPT
Exclusion is causing sites to continually be out of sync.
parent
78877f3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/class-cron-options-cpt.php
View file @
82d667e2
...
...
@@ -29,10 +29,6 @@ class Cron_Options_CPT extends Singleton {
// Data storage
add_action
(
'init'
,
array
(
$this
,
'register_post_type'
)
);
// Prevent Jetpack from syncing plugin's CPT entries
add_filter
(
'option_jetpack_sync_settings_post_types_blacklist'
,
array
(
$this
,
'exclude_from_jetpack_sync'
),
999
);
add_filter
(
'default_option_jetpack_sync_settings_post_types_blacklist'
,
array
(
$this
,
'exclude_from_jetpack_sync'
),
999
);
// Option interception
add_filter
(
'pre_option_cron'
,
array
(
$this
,
'get_option'
)
);
add_filter
(
'pre_update_option_cron'
,
array
(
$this
,
'update_option'
),
10
,
2
);
...
...
@@ -59,23 +55,6 @@ class Cron_Options_CPT extends Singleton {
}
}
/**
* Block Jetpack Sync from capturing plugin's data
*
* Data changes frequently and is of no value in any remote context
*/
public
function
exclude_from_jetpack_sync
(
$option_value
)
{
if
(
!
is_array
(
$option_value
)
)
{
$option_value
=
array
();
}
if
(
!
in_array
(
self
::
POST_TYPE
,
$option_value
)
)
{
$option_value
[]
=
self
::
POST_TYPE
;
}
return
$option_value
;
}
/**
* PLUGIN FUNCTIONALITY
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment