Support Forum ยป User Profile

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Groups Functionality #3539
    87Pancakes87Pancakes
    Participant

    Ok no worries. It's just not justifiable at the cost unfortunately so I will opt for coding the required number of boxes for the job. Thank-you for your help.

    in reply to: Code Simplification #3535
    87Pancakes87Pancakes
    Participant

    Thank-you ๐Ÿ™‚

    in reply to: Define multiple setting pages #3510
    87Pancakes87Pancakes
    Participant

    I figured this out;

    Here's the answer if anyone has the same question;

    <?php
    // Register settings page. In this case, it's a theme options page
    add_filter( 'mb_settings_pages', 'prefix_options_page' );
    function prefix_options_page( $settings_pages )
    {
    	$settings_pages[] = array(
    		'id'          => 'options',
    		'option_name' => 'options',
    		'menu_title'  => __( 'Options', 'textdomain' ),
    		'icon_url'    => 'dashicons-edit',
    		'style'       => 'no-boxes',
    		'columns'     => 1,
    		'tabs'        => array(
    			'general' => __( 'General Settings', 'textdomain' ),
    		),
    		'position'    => 2,
    	);
    	
    	$settings_pages[] = array(
    		'id'          => 'work',
    		'option_name' => 'work',
    		'menu_title'  => __( 'Work', 'textdomain' ),
    		'icon_url'    => 'dashicons-edit',
    		'style'       => 'no-boxes',
    		'columns'     => 1,
    		'tabs'        => array(
    			'featured' => __( 'Featured Work', 'textdomain' ),
    		),
    		'position'    => 2,
    	);
    	return $settings_pages;
    }
    // Register meta boxes and fields for settings page
    add_filter( 'rwmb_meta_boxes', 'prefix_options_meta_boxes' );
    function prefix_options_meta_boxes( $meta_boxes )
    {
    	$meta_boxes[] = array(
    		'id'             => 'general',
    		'title'          => __( 'General', 'textdomain' ),
    		'settings_pages' => 'options',
    		'tab'            => 'general',
    		'fields' => array(
    			array(
    				'name' => __( 'Logo Dark', 'textdomain' ),
    				'id'   => 'logo_dark',
    				'type' => 'file_input',
    			),
    			array(
    				'name' => __( 'Logo Light', 'textdomain' ),
    				'id'   => 'logo_dark',
    				'type' => 'file_input',
    			),
    
    		),
    	);
    	return $meta_boxes;
    }
    
    
    in reply to: Referencing Data from Settings Page #2072
    87Pancakes87Pancakes
    Participant

    Hi, it's in the header.

    I'm just using the code on this page; https://metabox.io/docs/mb-settings-page/

    I have fixed it now using the following code;

    <?php $field_id = 'twitter-url';
     if ( isset( $settings[$field_id] ) ) {
     echo '<li><a href=" ' . $settings[$field_id] . '"><i class="fa fa-twitter"></i></a></li>'; } ?>

    How do I echo nothing if the field is empty?

    in reply to: Referencing Data from Settings Page #2068
    87Pancakes87Pancakes
    Participant

    Any help would be greatly appreciated. ๐Ÿ™‚ Thank-you.

Viewing 5 posts - 1 through 5 (of 5 total)