|
/>
|
|
esc_html__( 'Forms in Gravity Forms', 'wsal-gravity-forms' ),
'gravityforms_confirmations' => esc_html__( 'Confirmations in Gravity Forms', 'wsal-gravity-forms' ),
'gravityforms_notifications' => esc_html__( 'Notifications in Gravity Forms', 'wsal-gravity-forms' ),
'gravityforms_entries' => esc_html__( 'Entries in Gravity Forms', 'wsal-gravity-forms' ),
'gravityforms_fields' => esc_html__( 'Fields in Gravity Forms', 'wsal-gravity-forms' ),
'gravityforms_settings' => esc_html__( 'Settings in Gravity Forms', 'wsal-gravity-forms' ),
);
// combine the two arrays.
$objects = array_merge( $objects, $new_objects );
return $objects;
}
function wsal_gravityforms_add_custom_event_type( $types ) {
$new_types = array(
'starred' => __( 'Starred', 'wsal-gravity-forms' ),
'unstarred' => __( 'Unstarred', 'wsal-gravity-forms' ),
'read' => __( 'Read', 'wsal-gravity-forms' ),
'unread' => __( 'Unread', 'wsal-gravity-forms' ),
'submitted' => __( 'Submitted', 'wsal-gravity-forms' ),
);
// combine the two arrays.
$types = array_merge( $types, $new_types );
return $types;
}
/**
* Add specific events so we can use them for category titles.
*/
function wsal_gravityforms_extension_togglealerts_sub_category_events( $sub_category_events ) {
$new_events = array( 5700, 5705, 5706, 5710, 5716 );
$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_gravityforms_extension_togglealerts_sub_category_titles( $title, $alert_id ) {
if ( 5700 === $alert_id ) {
$title = esc_html_e( 'Forms', 'wp-security-audit-log' );
}
if ( 5705 === $alert_id ) {
$title = esc_html_e( 'Form confirmations', 'wp-security-audit-log' );
}
if ( 5706 === $alert_id ) {
$title = esc_html_e( 'Form notifications', 'wp-security-audit-log' );
}
if ( 5710 === $alert_id ) {
$title = esc_html_e( 'Entries', 'wp-security-audit-log' );
}
if ( 5716 === $alert_id ) {
$title = esc_html_e( 'Settings', 'wp-security-audit-log' );
}
return $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_gravityforms_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_gravityforms_extension_replacement_duplicate_event_notice' );
}
}
/**
* Replacement "duplicate event" notice text.
*/
function wsal_gravityforms_extension_replacement_duplicate_event_notice() {
$replacement_text = __( 'You are running an old version of WP Activity Log. Please update the plugin to run it alongside this extension: GravityForms', 'wp-security-audit-log' );
?>