Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • […I feel like a douche now…] 😀

    What I see is that it looks like I can update data using everything except an empty field. Also, if I press the save button even without performing any edit to input fields data, I always get an “Settings updated” admin notice.

    (For the sake of information, I’m working on roots/bedrock based environment, while the CMB2 package is installed inside a wppb boilerplate based plugin, included as a mu-plugin)

    • This reply was modified 3 months, 3 weeks ago by .
    • This reply was modified 3 months, 3 weeks ago by .

    …yep, you’re right, sorry…

    $prefix = '_themename_options_';
    
    $main_options = new_cmb2_box(array(
        'id' => $prefix . 'main_options_page',
        'title' => esc_html('Options title', '_themename-site'),
        'object_types' => array(
            'options-page'
        ),
        'context' => 'normal',
        'priority' => 'high',
        'option_key' => '_themename_main_options', // The option key and admin menu page slug.
        'icon_url' => 'dashicons-building', // Menu icon. Only applicable if 'parent_slug' is left empty.
        'capability'      => 'manage_options', // Cap required to view options-page.
        'position' => 2 // Menu position. Only applicable if 'parent_slug' is left empty.
    ));
    
    /**
     *  MAIN OPTIONS META - TITLE
     */
    $main_options->add_field(array(
        'id' => $prefix . 'main_options_title',
        'name' => esc_html('General infos', '_themename-site'),
        'type' => 'title'
    ));
    /**
     *  MAIN OPTIONS META - COMPANY NAME
     */
    $main_options->add_field(array(
        'id' => $prefix . 'main_options_company_name',
        'name' => esc_html('Name', '_themename-site'),
        'desc' => esc_html('Insert name', '_themename-site'),
        'type' => 'text'
    ));
    
    [etc...]
    • This reply was modified 3 months, 3 weeks ago by .
    saxpaolo

    (@saxpaolo)

    OK got it.
    Actually I thought that a simple sql find/replace procedure was enough – e.g. in a wp_postmeta meta_value, like this one:

    a:12:{
    	i:1373;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_01.jpg";
    	i:1374;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_02.jpg";
    	i:1375;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_03.jpg";
    	i:1376;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_04.jpg";
    	i:1377;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_05.jpg";
    	i:1378;s:57:"http://local-site-name.test/wp-content/uploads/2019/11/slide_06.jpg";
    }

    Anyway, what you wrote is clear

    saxpaolo

    (@saxpaolo)

    Hello Michael, thanks for your prompt reply.
    …actually I’ve used find/replace method via phpMyAdmin, replacing local url with the prod server (UPDATE|SET|REPLACE). Does this procedure do not have effects to serialized data? The fact is that all the CMB2 fields data have been stored, except for the file_list field type.

    After tried many solutions (update permalink, disable plugins etc), here’s what worked for me:

    • create a new user with Admin role (from now on, is recommended to use two different browsers, for the first and the second account);
    • exit from the first Admin account and enter using the second one;
    • verify if this new Admin account succed to publish new posts/pages;
    • with this new account, diminish the role of the FIRST Admin user (eg. as Author);
    • enter in the admin using this Author account check if now it succed to publish new posts/pages;
    • if so, restore the Author account and set to Admin again;
    • …or simply, delete the first Admin and and use the second one.

    (…easier done than said).

    P.S.: As far as I know, the “Settings > Writing > Default editor” option is no more available.

    • This reply was modified 6 months, 2 weeks ago by .

    @jtsternberg …sooooooo easy!!!!! 😉

    That’s just perfect!

    Thanks for your support

    Paolo

    Hello Michael, thanks for your quick reply – and thanks for CMB2 plugin too! 🙂

    I already thought about that …the fact is that the names used by Fontawesome not always match the actual name of the social. E.g.:

    “linkedin-in” for LinkedIn
    “snapchat-ghost” for Snapchat
    “stumbleupon-circle” for StumbleUpon
    etc.

    So I thought that the use of the “key=>value” pair could be a nice solution (I mean, it’s not a vital issue for the plugin I’m working on right now, but this situation could occur again in other cases and for more critical data, so I was courious if there is an solution or a better approach…)

    Thanks again…

    • This reply was modified 1 year, 3 months ago by .

    Checking around I’ve found the solution to the above, using wp_list_categories and walker class…

    Check out the following solution:

    http://wordpress.stackexchange.com/questions/93627/wp-list-categories-add-class-to-all-list-items-with-children

    Hello cagdastakis, thanks for your quick reply

    …yes I’ve created the single-cpt_profiles.php file (I mean, I’m still working on it).

    But the fact is that I’d like to include the ul list I’ve posted above not inside the cpt template file, but in the homepage (and/or in a sidebar widget).
    Something just like a news box section, with a list of news title + the category or the tag of each single news, but instead of the category/tag I’d like to link to the profile post

    <ul>
     <li>
      <span><a href="link-2-cpt-profile-post">profile-name</a></span>
      <h2><a href="link-2-regular-post">news-title</a></h2>
     </li>
     <li>
      <span><a href="link-2-cpt-profile-post">profile-name</a></span>
      <h2><a href="link-2-regular-post">news-title</a></h2>
     </li>
     <!--etc-->
    </ul>
Viewing 10 replies - 1 through 10 (of 10 total)