Add option to log all post changes
This was previously done by default, now it needs to be turned on. Which is arguably better.
This commit is contained in:
parent
899f730eac
commit
29cf93b7a3
BIN
img/documentation/fictioneer_log_posts.jpg
Normal file
BIN
img/documentation/fictioneer_log_posts.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -701,6 +701,12 @@ define( 'FICTIONEER_OPTIONS', array(
|
|||||||
'group' => 'fictioneer-settings-general-group',
|
'group' => 'fictioneer-settings-general-group',
|
||||||
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
|
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
|
||||||
'default' => 0
|
'default' => 0
|
||||||
|
),
|
||||||
|
'fictioneer_log_posts' => array(
|
||||||
|
'name' => 'fictioneer_log_posts',
|
||||||
|
'group' => 'fictioneer-settings-general-group',
|
||||||
|
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
|
||||||
|
'default' => 0
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'integers' => array(
|
'integers' => array(
|
||||||
@ -1169,6 +1175,7 @@ function fictioneer_get_option_label( $option ) {
|
|||||||
'fictioneer_enable_query_result_caching' => __( 'Enable caching of large query results', 'fictioneer' ),
|
'fictioneer_enable_query_result_caching' => __( 'Enable caching of large query results', 'fictioneer' ),
|
||||||
'fictioneer_allow_rest_save_actions' => __( 'Allow REST requests to trigger save actions', 'fictioneer' ),
|
'fictioneer_allow_rest_save_actions' => __( 'Allow REST requests to trigger save actions', 'fictioneer' ),
|
||||||
'fictioneer_enable_global_splide' => __( 'Enable Splide slider globally', 'fictioneer' ),
|
'fictioneer_enable_global_splide' => __( 'Enable Splide slider globally', 'fictioneer' ),
|
||||||
|
'fictioneer_log_posts' => __( 'Log all post updates', 'fictioneer' ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,12 +141,18 @@ function fictioneer_get_wp_debug_log() {
|
|||||||
* Logs post update
|
* Logs post update
|
||||||
*
|
*
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
|
* @since 5.24.1 - Make dependant on option.
|
||||||
*
|
*
|
||||||
* @param int $post_id The post ID.
|
* @param int $post_id The post ID.
|
||||||
* @param string $action The action performed.
|
* @param string $action The action performed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function fictioneer_log_post_update( $post_id, $action ) {
|
function fictioneer_log_post_update( $post_id, $action ) {
|
||||||
|
// Log posts?
|
||||||
|
if ( ! get_option( 'fictioneer_log_posts' ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
$type_object = get_post_type_object( get_post_type( $post_id ) );
|
$type_object = get_post_type_object( get_post_type( $post_id ) );
|
||||||
$post_type_name = $type_object->labels->singular_name;
|
$post_type_name = $type_object->labels->singular_name;
|
||||||
|
@ -1155,6 +1155,18 @@ $images = get_template_directory_uri() . '/img/documentation/';
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="fictioneer-card__row">
|
||||||
|
<?php
|
||||||
|
fictioneer_settings_label_checkbox(
|
||||||
|
'fictioneer_log_posts',
|
||||||
|
__( 'Log all post updates', 'fictioneer' ),
|
||||||
|
__( 'If you want to track any and all changes.', 'fictioneer' ),
|
||||||
|
'Enable this option if you want to track every action made to any post: publishing, updating, trashing, and deleting. This may be useful if you have concerns about content changes, but it is not recommended for sites with a high throughput of posts.',
|
||||||
|
'<div class="helper-modal-image"><img src="' . $images . 'fictioneer_log_posts.jpg"></div>'
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="fictioneer-card__row">
|
<div class="fictioneer-card__row">
|
||||||
<?php
|
<?php
|
||||||
fictioneer_settings_label_checkbox(
|
fictioneer_settings_label_checkbox(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user