Plugin Directory

Changeset 2126773


Ignore:
Timestamp:
07/22/2019 04:25:49 PM (7 years ago)
Author:
feehatheme
Message:

version updated

Location:
maester-toolkit
Files:
35 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • maester-toolkit/trunk/inc/maester-toolkit-options.php

    r2126768 r2126773  
    33
    44
    5 if(!function_exists('maester_theme_options')){
    6     add_action('init', 'maester_theme_options');
    7     function maester_theme_options () {
    8         $config_id = 'maester_options';
    9         if(class_exists('Kirki')){
    10 
    11             Kirki::add_config( $config_id, array(
    12                 'capability'    => 'edit_theme_options',
    13                 'option_type'   => 'theme_mod'
    14             ));
    15             Kirki::add_panel( 'maester_options_panel', array(
    16                 'priority'    => 10,
    17                 'title'       => esc_html__( 'Maester Settings', 'maester' ),
    18                 'description' => esc_html__( 'Maester Theme Customization Options', 'maester' ),
    19             ));
    20 
    21             /**
    22             * Top Bar Options
    23             */
    24 
    25             Kirki::add_section( 'maester_topbar_options', array(
    26                 'title'          => esc_html__( 'Top Bar', 'maester' ),
    27                 'description'    => esc_html__( 'Top Bar Settings.', 'maester' ),
    28                 'panel'          => 'maester_options_panel',
    29                 'priority'       => 160,
    30             ) );
    31 
    32             Kirki::add_field( $config_id, array(
    33                 'type'        => 'toggle',
    34                 'settings'    => 'enable_topbar',
    35                 'label'       => esc_html__( 'Top Bar Enable/Disable', 'maester' ),
    36                 'section'     => 'maester_topbar_options',
    37                 'default'     => '1',
    38                 'priority'    => 10,
    39             ) );
    40 
    41             Kirki::add_field( $config_id, array(
    42                 'type'     => 'text',
    43                 'settings' => 'topbar_text',
    44                 'label'    => esc_html__( 'Header Top Text', 'maester' ),
    45                 'section'  => 'maester_topbar_options',
    46                 'default'  => esc_html__( 'Maester | Multipurpose WordPress LMS Theme with Elementor Page Builder', 'maester' ),
    47                 'priority' => 10,
    48                 'partial_refresh'    => array(
    49                     'topbar_text' => array(
    50                         'selector'        => '.top-bar-description',
    51                         'render_callback' => function() {
    52                             return get_theme_mod('topbar_text');
    53                         },
    54                     )
    55                 ),
    56             ));
    57 
    58             Kirki::add_field( $config_id, array(
    59                 'type'        => 'select',
    60                 'settings'    => 'topbar_custom_links',
    61                 'label'       => esc_html__( 'Menu Custom Links', 'maester' ),
    62                 'section'     => 'maester_topbar_options',
    63                 'default'     => array('login', 'profile', 'logout' ),
    64                 'priority'    => 10,
    65                 'multiple'    => 999,
    66                 'choices'     => array(
    67                     'search' => esc_html__( 'Search Icon', 'maester' ),
    68                     'login' => esc_html__( 'Login Link', 'maester' ),
    69                     'profile' => esc_html__( 'Profile Link', 'maester' ),
    70                     'logout' => esc_html__( 'Sign Out Link', 'maester' ),
    71                 ),
    72             ));
    73 
    74             Kirki::add_field( $config_id, array(
    75                 'type'        => 'repeater',
    76                 'label'       => esc_html__( 'Top Bar Social Icons', 'maester' ),
    77                 'section'     => 'maester_topbar_options',
    78                 'priority'    => 10,
    79                 'row_label' => array(
    80                     'type'  => 'text',
    81                     'value' => esc_html__('Social Icon: ', 'maester' ),
    82                 ),
    83                 'button_label' => esc_html__('Add New Soical Icon', 'maester' ),
    84                 'settings'     => 'topbar_social',
    85                 'default'      => array(),
    86                 'fields' => array(
    87                     'topbar_social_icon'  => array(
    88                         'type'        => 'text',
    89                         'label'       => esc_html__( 'Icon Class Name', 'maester' ),
    90                         'description' => sprintf('<a target="_blank" href="%s">%s</a> %s <br><span style="color: green">%s</span>', esc_url('https://fontawesome.com/cheatsheet/'), __('Click Here', 'maester'), __('to get icons list', 'maester'), __('Note: Use prefix `fab` for brand, `far` for regular, `fas` for solid icons', 'maester')),
    91                         'default'     => 'fab fa-facebook',
    92                     ),
    93                     'topbar_social_link'  => array(
    94                         'type'        => 'link',
    95                         'label'       => esc_html__( 'Icon URL', 'maester' ),
    96                         'description' => __( 'Example: <span style="color: green;">https://fb.com/your_user_name</span>', 'maester' ),
    97                         'default'     => '#',
    98                     ),
    99                     'topbar_social_link_target' => array(
    100                         'type'        => 'radio',
    101                         'label'       => esc_html__( 'Link target', 'maester' ),
    102                         'default'     => '_self',
    103                         'priority'    => 10,
    104                         'choices'     => array(
    105                             '_blank'   => esc_html__( 'Open in new tab', 'maester' ),
    106                             '_self' => __( 'Don\'t open in new tab', 'maester' )
    107                         ),
    108                     )
    109                 )
    110             ) );
    111 
    112             do_action('optons/maester_topbar_options', $config_id);
    113 
    114 
    115             /**
    116             * Header Options
    117             */
    118 
    119             Kirki::add_section( 'maester_header_options', array(
    120                 'title'          => esc_html__( 'Header & Menu Bar', 'maester' ),
    121                 'description'    => esc_html__( 'Header Settings.', 'maester' ),
    122                 'panel'          => 'maester_options_panel',
    123                 'priority'       => 160,
    124             ) );
    125 
    126 
    127             Kirki::add_field( $config_id, array(
    128                 'type'        => 'toggle',
    129                 'settings'    => 'maester_en_menubar',
    130                 'label'       => esc_html__( 'Enable Menubar', 'maester' ),
    131                 'section'     => 'maester_header_options',
    132                 'default'     => '1',
    133                 'priority'    => 10
    134             ) );
    135 
    136             Kirki::add_field( $config_id, array(
    137                 'type'        => 'toggle',
    138                 'settings'    => 'enable_header_search',
    139                 'label'       => esc_html__( 'Header Search Enable/Disable', 'maester' ),
    140                 'section'     => 'maester_header_options',
    141                 'default'     => '1',
    142                 'priority'    => 10,
    143                 'partial_refresh'    => array(
    144                     'enable_header_search' => array(
    145                         'selector'        => '.custom-search-form-column',
    146                         'render_callback' => function() {
    147                             return get_theme_mod('enable_header_search');
    148                         },
    149                     )
    150                 ),
    151             ));
    152 
    153             Kirki::add_field( $config_id, array(
    154                 'type'        => 'select',
    155                 'settings'    => 'header_search_post_types',
    156                 'label'       => esc_html__( 'Header Search Post Types', 'maester' ),
    157                 'section'     => 'maester_header_options',
    158                 'default'     => 'post',
    159                 'priority'    => 10,
    160                 'multiple'    => 0,
    161                 'choices'     => maester_search_post_types()
    162             ));
    163 
    164             Kirki::add_field( $config_id, array(
    165                 'type'        => 'toggle',
    166                 'settings'    => 'enable_header_cart',
    167                 'label'       => esc_html__( 'Enable Menubar Cart', 'maester' ),
    168                 'description' => __("NB: WooCommerce must be installed to see the cart icon", 'maester'),
    169                 'section'     => 'maester_header_options',
    170                 'default'     => '1',
    171                 'priority'    => 10,
    172                 'partial_refresh'    => array(
    173                     'enable_header_cart' => array(
    174                         'selector'        => '.header-cart-menu',
    175                         'render_callback' => function() {
    176                             return get_theme_mod('enable_header_cart');
    177                         },
    178                     )
    179                 ),
    180             ) );
    181 
    182             Kirki::add_field( $config_id, array(
    183                 'type'        => 'toggle',
    184                 'settings'    => 'enable_menubar_search_icon',
    185                 'label'       => esc_html__( 'Enable Menubar Search Icon', 'maester' ),
    186                 'section'     => 'maester_header_options',
    187                 'default'     => '1',
    188                 'priority'    => 10,
    189                 'partial_refresh'    => array(
    190                     'enable_menubar_search_icon' => array(
    191                         'selector'        => '.menubar-search-icon',
    192                         'render_callback' => function() {
    193                             return get_theme_mod('enable_menubar_search_icon');
    194                         },
    195                     )
    196                 ),
    197             ));
    198 
    199             Kirki::add_field( $config_id, array(
    200                 'type'        => 'toggle',
    201                 'settings'    => 'enable_header_login_icon',
    202                 'label'       => esc_html__( 'Enable Menubar Login Icon', 'maester' ),
    203                 'section'     => 'maester_header_options',
    204                 'default'     => '1',
    205                 'priority'    => 10,
    206                 'partial_refresh'    => array(
    207                     'enable_header_login_icon' => array(
    208                         'selector'        => '.menubar-login-icon',
    209                         'render_callback' => function() {
    210                             return get_theme_mod('enable_header_login_icon');
    211                         },
    212                     )
    213                 ),
    214             ) );
    215 
    216             Kirki::add_field( $config_id, array(
    217                 'type'        => 'repeater',
    218                 'label'       => esc_html__( 'Menu Bar Social Icons', 'maester' ),
    219                 'section'     => 'maester_header_options',
    220                 'priority'    => 10,
    221                 'row_label' => array(
    222                     'type'  => 'text',
    223                     'value' => esc_html__('Social Icon: ', 'maester' ),
    224                 ),
    225                 'button_label' => esc_html__('Add New Soical Icon', 'maester' ),
    226                 'settings'     => 'menubar_social',
    227                 'default'      => array(),
    228                 'fields' => array(
    229                     'menubar_social_icon'  => array(
    230                         'type'        => 'text',
    231                         'label'       => esc_html__( 'Icon Class Name', 'maester' ),
    232                         'description' => sprintf('<a target="_blank" href="%s">%s</a> %s <br><span style="color: green">%s</span>', esc_url('https://fontawesome.com/cheatsheet/'), __('Click Here', 'maester'), __('to get icons list', 'maester'), __('Note: Use prefix `fab` for brand, `far` for regular, `fas` for solid icons', 'maester')),
    233                         'default'     => 'fab fa-facebook',
    234                     ),
    235                     'menubar_social_link'  => array(
    236                         'type'        => 'link',
    237                         'label'       => esc_html__( 'Icon URL', 'maester' ),
    238                         'description' => __( 'Example: <span style="color: green;">https://fb.com/your_user_name</span>', 'maester' ),
    239                         'default'     => '#',
    240                     ),
    241                     'menubar_social_link_target' => array(
    242                         'type'        => 'radio',
    243                         'label'       => esc_html__( 'Link target', 'maester' ),
    244                         'default'     => '_self',
    245                         'priority'    => 10,
    246                         'choices'     => array(
    247                             '_blank'   => esc_html__( 'Open in new tab', 'maester' ),
    248                             '_self' => __( 'Don\'t open in new tab', 'maester' )
    249                         ),
    250                     )
    251                 )
    252             ) );
    253 
    254             do_action('optons/maester_header_options', $config_id);
    255 
    256             /**
    257             * Blog Options
    258             */
    259 
    260             Kirki::add_section( 'maester_blog_options', array(
    261                 'title'          => esc_html__( 'Blog Settings', 'maester' ),
    262                 'panel'          => 'maester_options_panel',
    263                 'priority'       => 160,
    264             ) );
    265 
    266             Kirki::add_field( $config_id, array(
    267                 'type'        => 'select',
    268                 'settings'    => 'post_column_count',
    269                 'label'       => esc_html__( 'Post Column', 'maester' ),
    270                 'tooltip'       => esc_html__( 'Choose how many post want to show in one row', 'maester' ),
    271                 'section'     => 'maester_blog_options',
    272                 'default'     => '6',
    273                 'priority'    => 10,
    274                 'multiple'    => 0,
    275                 'choices'     => array(
    276                     '12' => esc_html__( 'One Column', 'maester' ),
    277                     '6' => esc_html__( 'Two Column', 'maester' ),
    278                     '4' => esc_html__( 'Three Column', 'maester' ),
    279                     '3' => esc_html__( 'Four Column', 'maester' ),
    280                 ),
    281             ));
    282             //maester_excerpt_length
    283 
    284 
    285             Kirki::add_field( $config_id, [
    286                 'type'        => 'number',
    287                 'settings'    => 'maester_excerpt_length',
    288                 'label'       => esc_html__( 'Blog content/excerpt length', 'maester' ),
    289                 'section'     => 'maester_blog_options',
    290                 'default'     => 25
    291             ] );
    292 
    293 
    294             Kirki::add_field( $config_id, array(
    295                 'type'        => 'toggle',
    296                 'settings'    => 'enable_blog_thumbnail',
    297                 'label'       => esc_html__( 'Enable Blog Thumbnail', 'maester' ),
    298                 'section'     => 'maester_blog_options',
    299                 'default'     => '1',
    300                 'priority'    => 10,
    301             ) );
    302 
    303             Kirki::add_field( $config_id, array(
    304                 'type'        => 'toggle',
    305                 'settings'    => 'enable_blog_category',
    306                 'label'       => esc_html__( 'Enable Blog Category', 'maester' ),
    307                 'section'     => 'maester_blog_options',
    308                 'default'     => '1',
    309                 'priority'    => 10,
    310             ) );
    311 
    312             Kirki::add_field( $config_id, array(
    313                 'type'        => 'toggle',
    314                 'settings'    => 'enable_blog_content',
    315                 'label'       => esc_html__( 'Enable Blog Content', 'maester' ),
    316                 'section'     => 'maester_blog_options',
    317                 'default'     => '1',
    318                 'priority'    => 10,
    319             ) );
    320 
    321             /*Kirki::add_field( $config_id, array(
    322                 'type'        => 'toggle',
    323                 'settings'    => 'enable_blog_readmore',
    324                 'label'       => esc_html__( 'Enable Blog Readmore', 'maester' ),
    325                 'section'     => 'maester_blog_options',
    326                 'default'     => '0',
    327                 'priority'    => 10,
    328             ) );*/
    329 
    330             Kirki::add_field( $config_id, array(
    331                 'type'        => 'toggle',
    332                 'settings'    => 'enable_blog_author',
    333                 'label'       => esc_html__( 'Enable Blog author', 'maester' ),
    334                 'section'     => 'maester_blog_options',
    335                 'default'     => '1',
    336                 'priority'    => 10,
    337             ) );
    338 
    339             Kirki::add_field( $config_id, array(
    340                 'type'        => 'toggle',
    341                 'settings'    => 'enable_blog_date',
    342                 'label'       => esc_html__( 'Enable Blog Date', 'maester' ),
    343                 'section'     => 'maester_blog_options',
    344                 'default'     => '1',
    345                 'priority'    => 10,
    346             ) );
    347 
    348             do_action('optons/maester_blog_options', $config_id);
    349 
    350 
    351             /**
    352             * Single Blog Options
    353             */
    354 
    355             Kirki::add_section( 'maester_single_blog_options', array(
    356                 'title'          => esc_html__( 'Single Blog Settings', 'maester' ),
    357                 'panel'          => 'maester_options_panel',
    358                 'priority'       => 160,
    359             ) );
    360 
    361 
    362             Kirki::add_field( $config_id, array(
    363                 'type'        => 'toggle',
    364                 'settings'    => 'enable_single_blog_date',
    365                 'label'       => esc_html__( 'Enable Single Blog Date', 'maester' ),
    366                 'section'     => 'maester_single_blog_options',
    367                 'default'     => '1',
    368                 'priority'    => 10,
    369             ) );
    370 
    371 
    372             Kirki::add_field( $config_id, array(
    373                 'type'        => 'toggle',
    374                 'settings'    => 'enable_single_blog_author',
    375                 'label'       => esc_html__( 'Enable Single Blog Author', 'maester' ),
    376                 'section'     => 'maester_single_blog_options',
    377                 'default'     => '1',
    378                 'priority'    => 10,
    379             ) );
    380 
    381             Kirki::add_field( $config_id, array(
    382                 'type'        => 'toggle',
    383                 'settings'    => 'enable_single_blog_comment_number',
    384                 'label'       => esc_html__( 'Enable Single Blog Comment Number', 'maester' ),
    385                 'section'     => 'maester_single_blog_options',
    386                 'default'     => '1',
    387                 'priority'    => 10,
    388             ) );
    389 
    390             Kirki::add_field( $config_id, array(
    391                 'type'        => 'toggle',
    392                 'settings'    => 'enable_single_blog_category',
    393                 'label'       => esc_html__( 'Enable Single Blog Category', 'maester' ),
    394                 'section'     => 'maester_single_blog_options',
    395                 'default'     => '1',
    396                 'priority'    => 10,
    397             ) );
    398 
    399 
    400             Kirki::add_field( $config_id, array(
    401                 'type'        => 'toggle',
    402                 'settings'    => 'enable_single_blog_tag',
    403                 'label'       => esc_html__( 'Enable Single Blog Tag', 'maester' ),
    404                 'section'     => 'maester_single_blog_options',
    405                 'default'     => '1',
    406                 'priority'    => 10,
    407             ) );
    408 
    409             Kirki::add_field( $config_id, array(
    410                 'type'        => 'toggle',
    411                 'settings'    => 'enable_single_blog_navigation',
    412                 'label'       => esc_html__( 'Enable Single Blog Navigation', 'maester' ),
    413                 'section'     => 'maester_single_blog_options',
    414                 'default'     => '1',
    415                 'priority'    => 10,
    416             ) );
    417 
    418             Kirki::add_field( $config_id, array(
    419                 'type'        => 'toggle',
    420                 'settings'    => 'enable_single_blog_comments',
    421                 'label'       => esc_html__( 'Enable Single Blog Comments', 'maester' ),
    422                 'section'     => 'maester_single_blog_options',
    423                 'default'     => '1',
    424                 'priority'    => 10,
    425             ) );
    426 
    427             do_action('optons/maester_single_blog_options', $config_id);
    428 
    429             /**
    430             * Sidebar Options
    431             */
    432 
    433             Kirki::add_section( 'maester_sidebar_options', array(
    434                 'title'          => esc_html__( 'Sidebar Settings', 'maester' ),
    435                 'panel'          => 'maester_options_panel',
    436                 'priority'       => 160,
    437             ));
    438 
    439             Kirki::add_field( $config_id, array(
    440                 'type'        => 'toggle',
    441                 'settings'    => 'enable_blog_sidebar',
    442                 'label'       => esc_html__( 'Enable Blog Sidebar', 'maester' ),
    443                 'section'     => 'maester_sidebar_options',
    444                 'default'     => '1',
    445                 'priority'    => 10,
    446             ) );
    447 
    448             Kirki::add_field( $config_id, array(
    449                 'type'        => 'toggle',
    450                 'settings'    => 'enable_single_blog_sidebar',
    451                 'label'       => esc_html__( 'Enable Single Blog Sidebar', 'maester' ),
    452                 'section'     => 'maester_sidebar_options',
    453                 'default'     => '1',
    454                 'priority'    => 10,
    455             ));
    456 
    457             Kirki::add_field( $config_id, array(
    458                 'type'        => 'toggle',
    459                 'settings'    => 'enable_archive_sidebar',
    460                 'label'       => esc_html__( 'Enable Archive Sidebar', 'maester' ),
    461                 'section'     => 'maester_sidebar_options',
    462                 'default'     => '1',
    463                 'priority'    => 10,
    464             ));
    465 
    466             Kirki::add_field( $config_id, array(
    467                 'type'        => 'toggle',
    468                 'settings'    => 'enable_search_sidebar',
    469                 'label'       => esc_html__( 'Enable Search Sidebar', 'maester' ),
    470                 'section'     => 'maester_sidebar_options',
    471                 'default'     => '1',
    472                 'priority'    => 10,
    473             ));
    474 
    475             do_action('optons/maester_sidebar_options', $config_id);
    476 
    477             /**
    478             * Footer Options
    479             */
    480 
    481             Kirki::add_section( 'maester_footer_options', array(
    482                 'title'          => esc_html__( 'Footer Settings', 'maester' ),
    483                 'panel'          => 'maester_options_panel',
    484                 'priority'       => 160,
    485             ));
    486             Kirki::add_field( $config_id, array(
    487                 'type'        => 'toggle',
    488                 'settings'    => 'enable_footer',
    489                 'label'       => esc_html__( 'Enable Footer (Widget Area)', 'maester' ),
    490                 'section'     => 'maester_footer_options',
    491                 'default'     => '1',
    492                 'priority'    => 10,
    493             ));
    494             Kirki::add_field( $config_id, array(
    495                 'type'        => 'toggle',
    496                 'settings'    => 'enable_footer_bottom',
    497                 'label'       => esc_html__( 'Enable Footer Bottom (Copyright Area)', 'maester' ),
    498                 'section'     => 'maester_footer_options',
    499                 'default'     => '1',
    500                 'priority'    => 10,
    501             ));
    502             Kirki::add_field( $config_id, array(
    503                 'type'     => 'text',
    504                 'settings' => 'footer_text',
    505                 'label'    => esc_html__( 'Footer Text', 'maester' ),
    506                 'section'  => 'maester_footer_options',
    507                 'default'  => sprintf("&copy; %s %s. ", date('Y') , get_bloginfo('name')),
    508                 'priority' => 10,
    509                 'partial_refresh'    => array(
    510                     'footer_text' => array(
    511                         'selector'        => '.site-info p',
    512                         'render_callback' => function() {
    513                             return get_theme_mod('footer_text');
    514                         },
    515                     )
    516                 ),
    517             ));
    518 
    519             Kirki::add_field( $config_id, array(
    520                 'type'        => 'select',
    521                 'settings'    => 'footer_credit',
    522                 'label'       => esc_html__( 'Developer Credit', 'maester' ),
    523                 'section'     => 'maester_footer_options',
    524                 'default'     => 'credit_1',
    525                 'priority'    => 10,
    526                 'choices'     => maester_get_copyright_credits(true),
    527             ));
    528 
    529             if(!maester_toolkit()->pro){
    530                 Kirki::add_field( $config_id, [
    531                     'type'        => 'custom',
    532                     'settings'    => 'footer_copyright_get_pro',
    533                     'section'     => 'maester_footer_options',
    534                     'default'     => maester_toolki_customizer_pro_notice('disable-developer-credits.jpg'),
    535                     'priority'    => 10,
    536                 ] );
    537             }
    538 
    539             do_action('optons/maester_footer_options', $config_id);
    540 
    541 
    542             /**
    543             * Notice Panel
    544             */
    545 
    546             Kirki::add_section( 'maester_notice_options', array(
    547                 'title'          => esc_html__( 'Notice', 'maester' ),
    548                 'panel'          => 'maester_options_panel',
    549                 'priority'       => 160,
    550             ) );
    551 
    552 
    553             Kirki::add_field( $config_id, array(
    554                 'type'        => 'toggle',
    555                 'settings'    => 'maester_enable_notice',
    556                 'label'       => esc_html__( 'Enable Single Blog Date', 'maester' ),
    557                 'section'     => 'maester_notice_options',
    558                 'default'     => '0',
    559                 'priority'    => 10,
    560             ) );
    561 
    562             Kirki::add_field( $config_id, [
    563                 'type'     => 'text',
    564                 'settings' => 'maester_notice_text',
    565                 'label'    => esc_html__( 'Notice text', 'maester' ),
    566                 'section'  => 'maester_notice_options',
    567                 'default'  => esc_html__( 'Notice text here', 'maester' ),
    568                 'priority' => 10,
    569             ] );
    570 
    571             do_action('optons/maester_notice_options', $config_id);
    572 
    573         }
    574     }
    575 }
     5    if(!function_exists('maester_theme_options')){
     6        add_action('init', 'maester_theme_options');
     7        function maester_theme_options () {
     8            $config_id = 'maester_options';
     9            if(class_exists('Kirki')){
     10
     11                Kirki::add_config( $config_id, array(
     12                    'capability'    => 'edit_theme_options',
     13                    'option_type'   => 'theme_mod'
     14                ));
     15                Kirki::add_panel( 'maester_options_panel', array(
     16                    'priority'    => 10,
     17                    'title'       => esc_html__( 'Maester Settings', 'maester' ),
     18                    'description' => esc_html__( 'Maester Theme Customization Options', 'maester' ),
     19                ));
     20
     21                /**
     22                * Top Bar Options
     23                */
     24
     25                Kirki::add_section( 'maester_topbar_options', array(
     26                    'title'          => esc_html__( 'Top Bar', 'maester' ),
     27                    'description'    => esc_html__( 'Top Bar Settings.', 'maester' ),
     28                    'panel'          => 'maester_options_panel',
     29                    'priority'       => 160,
     30                ) );
     31
     32                Kirki::add_field( $config_id, array(
     33                    'type'        => 'toggle',
     34                    'settings'    => 'enable_topbar',
     35                    'label'       => esc_html__( 'Top Bar Enable/Disable', 'maester' ),
     36                    'section'     => 'maester_topbar_options',
     37                    'default'     => '1',
     38                    'priority'    => 10,
     39                ) );
     40
     41                Kirki::add_field( $config_id, array(
     42                    'type'     => 'text',
     43                    'settings' => 'topbar_text',
     44                    'label'    => esc_html__( 'Header Top Text', 'maester' ),
     45                    'section'  => 'maester_topbar_options',
     46                    'default'  => esc_html__( 'Maester | Multipurpose WordPress LMS Theme with Elementor Page Builder', 'maester' ),
     47                    'priority' => 10,
     48                    'partial_refresh'    => array(
     49                        'topbar_text' => array(
     50                            'selector'        => '.top-bar-description',
     51                            'render_callback' => function() {
     52                                return get_theme_mod('topbar_text');
     53                            },
     54                        )
     55                    ),
     56                ));
     57
     58                Kirki::add_field( $config_id, array(
     59                    'type'        => 'select',
     60                    'settings'    => 'topbar_custom_links',
     61                    'label'       => esc_html__( 'Menu Custom Links', 'maester' ),
     62                    'section'     => 'maester_topbar_options',
     63                    'default'     => array('login', 'profile', 'logout' ),
     64                    'priority'    => 10,
     65                    'multiple'    => 999,
     66                    'choices'     => array(
     67                        'search' => esc_html__( 'Search Icon', 'maester' ),
     68                        'login' => esc_html__( 'Login Link', 'maester' ),
     69                        'profile' => esc_html__( 'Profile Link', 'maester' ),
     70                        'logout' => esc_html__( 'Sign Out Link', 'maester' ),
     71                    ),
     72                ));
     73
     74                Kirki::add_field( $config_id, array(
     75                    'type'        => 'repeater',
     76                    'label'       => esc_html__( 'Top Bar Social Icons', 'maester' ),
     77                    'section'     => 'maester_topbar_options',
     78                    'priority'    => 10,
     79                    'row_label' => array(
     80                        'type'  => 'text',
     81                        'value' => esc_html__('Social Icon: ', 'maester' ),
     82                    ),
     83                    'button_label' => esc_html__('Add New Soical Icon', 'maester' ),
     84                    'settings'     => 'topbar_social',
     85                    'default'      => array(),
     86                    'fields' => array(
     87                        'topbar_social_icon'  => array(
     88                            'type'        => 'text',
     89                            'label'       => esc_html__( 'Icon Class Name', 'maester' ),
     90                            'description' => sprintf('<a target="_blank" href="%s">%s</a> %s <br><span style="color: green">%s</span>', esc_url('https://fontawesome.com/cheatsheet/'), __('Click Here', 'maester'), __('to get icons list', 'maester'), __('Note: Use prefix `fab` for brand, `far` for regular, `fas` for solid icons', 'maester')),
     91                            'default'     => 'fab fa-facebook',
     92                        ),
     93                        'topbar_social_link'  => array(
     94                            'type'        => 'link',
     95                            'label'       => esc_html__( 'Icon URL', 'maester' ),
     96                            'description' => __( 'Example: <span style="color: green;">https://fb.com/your_user_name</span>', 'maester' ),
     97                            'default'     => '#',
     98                        ),
     99                        'topbar_social_link_target' => array(
     100                            'type'        => 'radio',
     101                            'label'       => esc_html__( 'Link target', 'maester' ),
     102                            'default'     => '_self',
     103                            'priority'    => 10,
     104                            'choices'     => array(
     105                                '_blank'   => esc_html__( 'Open in new tab', 'maester' ),
     106                                '_self' => __( 'Don\'t open in new tab', 'maester' )
     107                            ),
     108                        )
     109                    )
     110                ) );
     111
     112                do_action('optons/maester_topbar_options', $config_id);
     113
     114
     115                /**
     116                * Header Options
     117                */
     118
     119                Kirki::add_section( 'maester_header_options', array(
     120                    'title'          => esc_html__( 'Header & Menu Bar', 'maester' ),
     121                    'description'    => esc_html__( 'Header Settings.', 'maester' ),
     122                    'panel'          => 'maester_options_panel',
     123                    'priority'       => 160,
     124                ) );
     125
     126
     127                Kirki::add_field( $config_id, array(
     128                    'type'        => 'toggle',
     129                    'settings'    => 'maester_en_menubar',
     130                    'label'       => esc_html__( 'Enable Menubar', 'maester' ),
     131                    'section'     => 'maester_header_options',
     132                    'default'     => '1',
     133                    'priority'    => 10
     134                ) );
     135
     136                Kirki::add_field( $config_id, array(
     137                    'type'        => 'toggle',
     138                    'settings'    => 'enable_header_search',
     139                    'label'       => esc_html__( 'Header Search Enable/Disable', 'maester' ),
     140                    'section'     => 'maester_header_options',
     141                    'default'     => '1',
     142                    'priority'    => 10,
     143                    'partial_refresh'    => array(
     144                        'enable_header_search' => array(
     145                            'selector'        => '.custom-search-form-column',
     146                            'render_callback' => function() {
     147                                return get_theme_mod('enable_header_search');
     148                            },
     149                        )
     150                    ),
     151                ));
     152
     153                Kirki::add_field( $config_id, array(
     154                    'type'        => 'select',
     155                    'settings'    => 'header_search_post_types',
     156                    'label'       => esc_html__( 'Header Search Post Types', 'maester' ),
     157                    'section'     => 'maester_header_options',
     158                    'default'     => 'post',
     159                    'priority'    => 10,
     160                    'multiple'    => 0,
     161                    'choices'     => function_exists("maester_search_post_types") ? maester_search_post_types() : array()
     162                ));
     163
     164                Kirki::add_field( $config_id, array(
     165                    'type'        => 'toggle',
     166                    'settings'    => 'enable_header_cart',
     167                    'label'       => esc_html__( 'Enable Menubar Cart', 'maester' ),
     168                    'description' => __("NB: WooCommerce must be installed to see the cart icon", 'maester'),
     169                    'section'     => 'maester_header_options',
     170                    'default'     => '1',
     171                    'priority'    => 10,
     172                    'partial_refresh'    => array(
     173                        'enable_header_cart' => array(
     174                            'selector'        => '.header-cart-menu',
     175                            'render_callback' => function() {
     176                                return get_theme_mod('enable_header_cart');
     177                            },
     178                        )
     179                    ),
     180                ) );
     181
     182                Kirki::add_field( $config_id, array(
     183                    'type'        => 'toggle',
     184                    'settings'    => 'enable_menubar_search_icon',
     185                    'label'       => esc_html__( 'Enable Menubar Search Icon', 'maester' ),
     186                    'section'     => 'maester_header_options',
     187                    'default'     => '1',
     188                    'priority'    => 10,
     189                    'partial_refresh'    => array(
     190                        'enable_menubar_search_icon' => array(
     191                            'selector'        => '.menubar-search-icon',
     192                            'render_callback' => function() {
     193                                return get_theme_mod('enable_menubar_search_icon');
     194                            },
     195                        )
     196                    ),
     197                ));
     198
     199                Kirki::add_field( $config_id, array(
     200                    'type'        => 'toggle',
     201                    'settings'    => 'enable_header_login_icon',
     202                    'label'       => esc_html__( 'Enable Menubar Login Icon', 'maester' ),
     203                    'section'     => 'maester_header_options',
     204                    'default'     => '1',
     205                    'priority'    => 10,
     206                    'partial_refresh'    => array(
     207                        'enable_header_login_icon' => array(
     208                            'selector'        => '.menubar-login-icon',
     209                            'render_callback' => function() {
     210                                return get_theme_mod('enable_header_login_icon');
     211                            },
     212                        )
     213                    ),
     214                ) );
     215
     216                Kirki::add_field( $config_id, array(
     217                    'type'        => 'repeater',
     218                    'label'       => esc_html__( 'Menu Bar Social Icons', 'maester' ),
     219                    'section'     => 'maester_header_options',
     220                    'priority'    => 10,
     221                    'row_label' => array(
     222                        'type'  => 'text',
     223                        'value' => esc_html__('Social Icon: ', 'maester' ),
     224                    ),
     225                    'button_label' => esc_html__('Add New Soical Icon', 'maester' ),
     226                    'settings'     => 'menubar_social',
     227                    'default'      => array(),
     228                    'fields' => array(
     229                        'menubar_social_icon'  => array(
     230                            'type'        => 'text',
     231                            'label'       => esc_html__( 'Icon Class Name', 'maester' ),
     232                            'description' => sprintf('<a target="_blank" href="%s">%s</a> %s <br><span style="color: green">%s</span>', esc_url('https://fontawesome.com/cheatsheet/'), __('Click Here', 'maester'), __('to get icons list', 'maester'), __('Note: Use prefix `fab` for brand, `far` for regular, `fas` for solid icons', 'maester')),
     233                            'default'     => 'fab fa-facebook',
     234                        ),
     235                        'menubar_social_link'  => array(
     236                            'type'        => 'link',
     237                            'label'       => esc_html__( 'Icon URL', 'maester' ),
     238                            'description' => __( 'Example: <span style="color: green;">https://fb.com/your_user_name</span>', 'maester' ),
     239                            'default'     => '#',
     240                        ),
     241                        'menubar_social_link_target' => array(
     242                            'type'        => 'radio',
     243                            'label'       => esc_html__( 'Link target', 'maester' ),
     244                            'default'     => '_self',
     245                            'priority'    => 10,
     246                            'choices'     => array(
     247                                '_blank'   => esc_html__( 'Open in new tab', 'maester' ),
     248                                '_self' => __( 'Don\'t open in new tab', 'maester' )
     249                            ),
     250                        )
     251                    )
     252                ) );
     253
     254                do_action('optons/maester_header_options', $config_id);
     255
     256                /**
     257                * Blog Options
     258                */
     259
     260                Kirki::add_section( 'maester_blog_options', array(
     261                    'title'          => esc_html__( 'Blog Settings', 'maester' ),
     262                    'panel'          => 'maester_options_panel',
     263                    'priority'       => 160,
     264                ) );
     265
     266                Kirki::add_field( $config_id, array(
     267                    'type'        => 'select',
     268                    'settings'    => 'post_column_count',
     269                    'label'       => esc_html__( 'Post Column', 'maester' ),
     270                    'tooltip'       => esc_html__( 'Choose how many post want to show in one row', 'maester' ),
     271                    'section'     => 'maester_blog_options',
     272                    'default'     => '6',
     273                    'priority'    => 10,
     274                    'multiple'    => 0,
     275                    'choices'     => array(
     276                        '12' => esc_html__( 'One Column', 'maester' ),
     277                        '6' => esc_html__( 'Two Column', 'maester' ),
     278                        '4' => esc_html__( 'Three Column', 'maester' ),
     279                        '3' => esc_html__( 'Four Column', 'maester' ),
     280                    ),
     281                ));
     282                //maester_excerpt_length
     283
     284
     285                Kirki::add_field( $config_id, [
     286                    'type'        => 'number',
     287                    'settings'    => 'maester_excerpt_length',
     288                    'label'       => esc_html__( 'Blog content/excerpt length', 'maester' ),
     289                    'section'     => 'maester_blog_options',
     290                    'default'     => 25
     291                ] );
     292
     293
     294                Kirki::add_field( $config_id, array(
     295                    'type'        => 'toggle',
     296                    'settings'    => 'enable_blog_thumbnail',
     297                    'label'       => esc_html__( 'Enable Blog Thumbnail', 'maester' ),
     298                    'section'     => 'maester_blog_options',
     299                    'default'     => '1',
     300                    'priority'    => 10,
     301                ) );
     302
     303                Kirki::add_field( $config_id, array(
     304                    'type'        => 'toggle',
     305                    'settings'    => 'enable_blog_category',
     306                    'label'       => esc_html__( 'Enable Blog Category', 'maester' ),
     307                    'section'     => 'maester_blog_options',
     308                    'default'     => '1',
     309                    'priority'    => 10,
     310                ) );
     311
     312                Kirki::add_field( $config_id, array(
     313                    'type'        => 'toggle',
     314                    'settings'    => 'enable_blog_content',
     315                    'label'       => esc_html__( 'Enable Blog Content', 'maester' ),
     316                    'section'     => 'maester_blog_options',
     317                    'default'     => '1',
     318                    'priority'    => 10,
     319                ) );
     320
     321                /*Kirki::add_field( $config_id, array(
     322                    'type'        => 'toggle',
     323                    'settings'    => 'enable_blog_readmore',
     324                    'label'       => esc_html__( 'Enable Blog Readmore', 'maester' ),
     325                    'section'     => 'maester_blog_options',
     326                    'default'     => '0',
     327                    'priority'    => 10,
     328                ) );*/
     329
     330                Kirki::add_field( $config_id, array(
     331                    'type'        => 'toggle',
     332                    'settings'    => 'enable_blog_author',
     333                    'label'       => esc_html__( 'Enable Blog author', 'maester' ),
     334                    'section'     => 'maester_blog_options',
     335                    'default'     => '1',
     336                    'priority'    => 10,
     337                ) );
     338
     339                Kirki::add_field( $config_id, array(
     340                    'type'        => 'toggle',
     341                    'settings'    => 'enable_blog_date',
     342                    'label'       => esc_html__( 'Enable Blog Date', 'maester' ),
     343                    'section'     => 'maester_blog_options',
     344                    'default'     => '1',
     345                    'priority'    => 10,
     346                ) );
     347
     348                do_action('optons/maester_blog_options', $config_id);
     349
     350
     351                /**
     352                * Single Blog Options
     353                */
     354
     355                Kirki::add_section( 'maester_single_blog_options', array(
     356                    'title'          => esc_html__( 'Single Blog Settings', 'maester' ),
     357                    'panel'          => 'maester_options_panel',
     358                    'priority'       => 160,
     359                ) );
     360
     361
     362                Kirki::add_field( $config_id, array(
     363                    'type'        => 'toggle',
     364                    'settings'    => 'enable_single_blog_date',
     365                    'label'       => esc_html__( 'Enable Single Blog Date', 'maester' ),
     366                    'section'     => 'maester_single_blog_options',
     367                    'default'     => '1',
     368                    'priority'    => 10,
     369                ) );
     370
     371
     372                Kirki::add_field( $config_id, array(
     373                    'type'        => 'toggle',
     374                    'settings'    => 'enable_single_blog_author',
     375                    'label'       => esc_html__( 'Enable Single Blog Author', 'maester' ),
     376                    'section'     => 'maester_single_blog_options',
     377                    'default'     => '1',
     378                    'priority'    => 10,
     379                ) );
     380
     381                Kirki::add_field( $config_id, array(
     382                    'type'        => 'toggle',
     383                    'settings'    => 'enable_single_blog_comment_number',
     384                    'label'       => esc_html__( 'Enable Single Blog Comment Number', 'maester' ),
     385                    'section'     => 'maester_single_blog_options',
     386                    'default'     => '1',
     387                    'priority'    => 10,
     388                ) );
     389
     390                Kirki::add_field( $config_id, array(
     391                    'type'        => 'toggle',
     392                    'settings'    => 'enable_single_blog_category',
     393                    'label'       => esc_html__( 'Enable Single Blog Category', 'maester' ),
     394                    'section'     => 'maester_single_blog_options',
     395                    'default'     => '1',
     396                    'priority'    => 10,
     397                ) );
     398
     399
     400                Kirki::add_field( $config_id, array(
     401                    'type'        => 'toggle',
     402                    'settings'    => 'enable_single_blog_tag',
     403                    'label'       => esc_html__( 'Enable Single Blog Tag', 'maester' ),
     404                    'section'     => 'maester_single_blog_options',
     405                    'default'     => '1',
     406                    'priority'    => 10,
     407                ) );
     408
     409                Kirki::add_field( $config_id, array(
     410                    'type'        => 'toggle',
     411                    'settings'    => 'enable_single_blog_navigation',
     412                    'label'       => esc_html__( 'Enable Single Blog Navigation', 'maester' ),
     413                    'section'     => 'maester_single_blog_options',
     414                    'default'     => '1',
     415                    'priority'    => 10,
     416                ) );
     417
     418                Kirki::add_field( $config_id, array(
     419                    'type'        => 'toggle',
     420                    'settings'    => 'enable_single_blog_comments',
     421                    'label'       => esc_html__( 'Enable Single Blog Comments', 'maester' ),
     422                    'section'     => 'maester_single_blog_options',
     423                    'default'     => '1',
     424                    'priority'    => 10,
     425                ) );
     426
     427                do_action('optons/maester_single_blog_options', $config_id);
     428
     429                /**
     430                * Sidebar Options
     431                */
     432
     433                Kirki::add_section( 'maester_sidebar_options', array(
     434                    'title'          => esc_html__( 'Sidebar Settings', 'maester' ),
     435                    'panel'          => 'maester_options_panel',
     436                    'priority'       => 160,
     437                ));
     438
     439                Kirki::add_field( $config_id, array(
     440                    'type'        => 'toggle',
     441                    'settings'    => 'enable_blog_sidebar',
     442                    'label'       => esc_html__( 'Enable Blog Sidebar', 'maester' ),
     443                    'section'     => 'maester_sidebar_options',
     444                    'default'     => '1',
     445                    'priority'    => 10,
     446                ) );
     447
     448                Kirki::add_field( $config_id, array(
     449                    'type'        => 'toggle',
     450                    'settings'    => 'enable_single_blog_sidebar',
     451                    'label'       => esc_html__( 'Enable Single Blog Sidebar', 'maester' ),
     452                    'section'     => 'maester_sidebar_options',
     453                    'default'     => '1',
     454                    'priority'    => 10,
     455                ));
     456
     457                Kirki::add_field( $config_id, array(
     458                    'type'        => 'toggle',
     459                    'settings'    => 'enable_archive_sidebar',
     460                    'label'       => esc_html__( 'Enable Archive Sidebar', 'maester' ),
     461                    'section'     => 'maester_sidebar_options',
     462                    'default'     => '1',
     463                    'priority'    => 10,
     464                ));
     465
     466                Kirki::add_field( $config_id, array(
     467                    'type'        => 'toggle',
     468                    'settings'    => 'enable_search_sidebar',
     469                    'label'       => esc_html__( 'Enable Search Sidebar', 'maester' ),
     470                    'section'     => 'maester_sidebar_options',
     471                    'default'     => '1',
     472                    'priority'    => 10,
     473                ));
     474
     475                do_action('optons/maester_sidebar_options', $config_id);
     476
     477                /**
     478                * Footer Options
     479                */
     480
     481                Kirki::add_section( 'maester_footer_options', array(
     482                    'title'          => esc_html__( 'Footer Settings', 'maester' ),
     483                    'panel'          => 'maester_options_panel',
     484                    'priority'       => 160,
     485                ));
     486                Kirki::add_field( $config_id, array(
     487                    'type'        => 'toggle',
     488                    'settings'    => 'enable_footer',
     489                    'label'       => esc_html__( 'Enable Footer (Widget Area)', 'maester' ),
     490                    'section'     => 'maester_footer_options',
     491                    'default'     => '1',
     492                    'priority'    => 10,
     493                ));
     494                Kirki::add_field( $config_id, array(
     495                    'type'        => 'toggle',
     496                    'settings'    => 'enable_footer_bottom',
     497                    'label'       => esc_html__( 'Enable Footer Bottom (Copyright Area)', 'maester' ),
     498                    'section'     => 'maester_footer_options',
     499                    'default'     => '1',
     500                    'priority'    => 10,
     501                ));
     502                Kirki::add_field( $config_id, array(
     503                    'type'     => 'text',
     504                    'settings' => 'footer_text',
     505                    'label'    => esc_html__( 'Footer Text', 'maester' ),
     506                    'section'  => 'maester_footer_options',
     507                    'default'  => sprintf("&copy; %s %s. ", date('Y') , get_bloginfo('name')),
     508                    'priority' => 10,
     509                    'partial_refresh'    => array(
     510                        'footer_text' => array(
     511                            'selector'        => '.site-info p',
     512                            'render_callback' => function() {
     513                                return get_theme_mod('footer_text');
     514                            },
     515                        )
     516                    ),
     517                ));
     518
     519                Kirki::add_field( $config_id, array(
     520                    'type'        => 'select',
     521                    'settings'    => 'footer_credit',
     522                    'label'       => esc_html__( 'Developer Credit', 'maester' ),
     523                    'section'     => 'maester_footer_options',
     524                    'default'     => 'credit_1',
     525                    'priority'    => 10,
     526                    'choices'     => function_exists('maester_get_copyright_credits') ? maester_get_copyright_credits(true) : array(),
     527                ));
     528
     529                if(!maester_toolkit()->pro){
     530                    Kirki::add_field( $config_id, [
     531                        'type'        => 'custom',
     532                        'settings'    => 'footer_copyright_get_pro',
     533                        'section'     => 'maester_footer_options',
     534                        'default'     => maester_toolki_customizer_pro_notice('disable-developer-credits.jpg'),
     535                        'priority'    => 10,
     536                    ] );
     537                }
     538
     539                do_action('optons/maester_footer_options', $config_id);
     540
     541
     542                /**
     543                * Notice Panel
     544                */
     545
     546                Kirki::add_section( 'maester_notice_options', array(
     547                    'title'          => esc_html__( 'Notice', 'maester' ),
     548                    'panel'          => 'maester_options_panel',
     549                    'priority'       => 160,
     550                ) );
     551
     552
     553                Kirki::add_field( $config_id, array(
     554                    'type'        => 'toggle',
     555                    'settings'    => 'maester_enable_notice',
     556                    'label'       => esc_html__( 'Enable Single Blog Date', 'maester' ),
     557                    'section'     => 'maester_notice_options',
     558                    'default'     => '0',
     559                    'priority'    => 10,
     560                ) );
     561
     562                Kirki::add_field( $config_id, [
     563                    'type'     => 'text',
     564                    'settings' => 'maester_notice_text',
     565                    'label'    => esc_html__( 'Notice text', 'maester' ),
     566                    'section'  => 'maester_notice_options',
     567                    'default'  => esc_html__( 'Notice text here', 'maester' ),
     568                    'priority' => 10,
     569                ] );
     570
     571                do_action('optons/maester_notice_options', $config_id);
     572
     573            }
     574        }
     575    }
  • maester-toolkit/trunk/maester-toolkit.php

    r2126768 r2126773  
    66    Description: An essential toolkit plugin for Maester Theme
    77    Author: feehatheme
    8     Version: 1.0.4
     8    Version: 1.0.5
    99    Author URI: https://feeha.net
    1010    Requires at least: 4.5
     
    2121     * Defined the maester const
    2222     */
    23     define('MAESTER_VERSION', '1.0.4');
     23    define('MAESTER_VERSION', '1.0.5');
    2424    define('MAESTER_TOOLKIT', __DIR__);
    2525    define('MAESTER_TOOLKIT_FILE', __FILE__);
Note: See TracChangeset for help on using the changeset viewer.