Guest User

Meta Box Settins - Backup

a guest
May 8th, 2020
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Register settings pages
  3.  *
  4.  * @since    3.0
  5.  * @access   public
  6.  * @var      array $settings_pages    
  7. */
  8. function ditty_settings_pages() {
  9.   $settings_pages[] = array(
  10.     'id'          => 'ditty_settings',
  11.     'option_name' => 'ditty_settings',
  12.     'menu_title'  => __( 'Settings', 'ditty-news-ticker' ),
  13.     'capability'    => 'manage_ditty_settings',
  14.     'parent'            => 'edit.php?post_type=ditty_ticker',
  15.     'style'       => 'no-boxes',
  16.     'columns'     => 2,
  17.     'tabs'        => array(
  18.       'backup'  => __( 'Backup & Restore', 'ditty-news-ticker' ),
  19.     ),
  20.   );
  21.   return $settings_pages;
  22. }
  23. add_filter( 'mb_settings_pages', 'ditty_settings_pages' );
  24.  
  25. /**
  26.  * Register settings metaboxes
  27.  *
  28.  * @since    3.0
  29.  * @access   public
  30.  * @var      array $meta_boxes    
  31. */
  32. function ditty_settings_metaboxes( $meta_boxes ) {
  33.     $meta_boxes[] = array(
  34.       'id'             => 'backup',
  35.       'title'          => __( 'Backup & Restore', 'ditty-news-ticker' ),
  36.       'settings_pages' => 'ditty_settings',
  37.       'tab'            => 'backup',
  38.       'fields'         => array(
  39.           array(
  40.               'name' => __( 'Backup & Restore', 'ditty-news-ticker' ),
  41.             'type' => 'backup',
  42.           ),
  43.       ),
  44.     );
  45.     return $meta_boxes;
  46. }
  47. add_filter( 'rwmb_meta_boxes', 'ditty_settings_metaboxes' );
RAW Paste Data