array( 'debug_mode' => '0', // values: 0 or 1 'cron_run_time_log' => '0', // run scheduler, cron run time text file log will be saved in plugin folder 'cron_scheduler_check_log' => '0', // run scheduler, cron check file log will be saved in plugin folder ), ); return apply_filters( 'ataswp_global_filters', $filters ); // <- extensible } /** * Main pages tabs. * * @since 1.0.0 * @return array $tabs */ public static function main_pages_tabs() { $tabs = array( 'schedules' => __( 'Scheduler', 'ataswp_lang' ), // schedules.php 'autopost' => __( 'Auto Post', 'ataswp_lang' ), // autopost.php 'accounts' => __( 'Accounts', 'ataswp_lang' ), // accounts.php ); return apply_filters( 'ataswp_main_pages_tabs', $tabs ); // <- extensible } /** * Sub pages tabs. * * @since 1.0.0 * @return array $tabs */ public static function sub_pages_tabs($main) { if ( empty( $main ) ) return; if ( $main == 'schedules' ) { $tabs = array( 'schedules' => __( 'Schedules', 'ataswp_lang' ), 'scheduler-log' => __( 'Log', 'ataswp_lang' ), 'importer' => __( 'Importer', 'ataswp_lang' ), 'settings' => __( 'Settings', 'ataswp_lang' ), ); return apply_filters( 'ataswp_scheduler_sub_pages_tabs', $tabs ); // <- extensible } elseif ( $main == 'autopost' ) { $tabs = array( 'settings' => __( 'Settings', 'ataswp_lang' ), ); return apply_filters( 'ataswp_autopost_sub_pages_tabs', $tabs ); // <- extensible } elseif ( $main == 'accounts' ) { $tabs = array( 'accounts' => __( 'Accounts', 'ataswp_lang' ), ); return apply_filters( 'ataswp_accounts_sub_pages_tabs', $tabs ); // <- extensible } else { return; } } /** * Get registered post types. * * @since 1.0.0 * @return array $post_types */ public static function get_registered_post_types() { $post_types = get_post_types(); unset($post_types['revision']); unset($post_types['attachment']); unset($post_types['nav_menu_item']); unset($post_types['post_tag']); return $post_types; } /** * Get registered taxonomies. * * @since 1.0.0 * @return array $taxonomies */ public static function get_registered_taxonomies() { $taxonomies = get_taxonomies(); unset($taxonomies['nav_menu']); unset($taxonomies['post_format']); return $taxonomies; } /** * Output admin Ajax notification messages. * * @since 1.0.0 * @return void */ public static function displayAjaxFormsValidationResult($validation='', $type='success') { $output = ''; if ( $validation != '') { if ($type == 'success') { $type = 'alert-success'; // css } else if ($type == 'info') { $type = 'alert-info'; // css } else if ($type == 'error') { $type = 'alert-danger'; // css } // display validation error messages if( $validation != '' ) { $output .= '