__( 'Yoast SEO', 'wp-security-audit-log' ),
'yoast-seo-metabox' => __( 'Yoast SEO Meta Box', 'wp-security-audit-log' ),
);
// combine the two arrays.
$objects = array_merge( $objects, $new_objects );
return $objects;
}
/**
* Add specific events so we can use them for category titles.
*/
function wsal_yoast_seo_extension_togglealerts_sub_category_events( $sub_category_events ) {
$new_events = array( 8813, 8815, 8838 );
$sub_category_events = array_merge( $sub_category_events, $new_events );
return $sub_category_events;
}
/**
* Add sub cateogry titles to ToggleView page in WSAL.
*/
function wsal_yoast_seo_extension_togglealerts_sub_category_titles( $subcat_title, $alert_id ) {
if ( 8815 === $alert_id ) {
$subcat_title = esc_html_e( 'Features:', 'wp-security-audit-log' );
}
else if ( 8813 === $alert_id ) {
$subcat_title = esc_html_e( 'Search Appearance', 'wp-security-audit-log' );
}
else if ( 8838 === $alert_id ) {
$subcat_title = esc_html_e( 'Multisite network', 'wp-security-audit-log' );
}
return $subcat_title;
}
/**
* If a user is running an older version of WSAL, they will see a "duplicate event" error.
* This function checks and runs a filter to replace that notice. Its done via JS as we cant
* currently give this notice a neat ID/class.
*/
function wsal_yoast_seo_extension_replace_duplicate_event_notice() {
$wsal_version = get_site_option( 'wsal_version' );
if ( version_compare( $wsal_version, '4.1.3.2', '<=' ) ) {
add_action( 'admin_footer', 'wsal_yoast_seo_extension_replacement_duplicate_event_notice' );
}
if ( isset( $_REQUEST['page'] ) && 'wsal-togglealerts' === $_REQUEST['page'] ) {
add_action( 'admin_footer', 'wsal_yoast_seo_extension_hide_obsolete_events' );
}
}
/**
* Temporary function to hide events using CSS, to be removed once WSAL 4.3 is released.
*/
function wsal_yoast_seo_extension_hide_obsolete_events() {
?>