Forum Replies Created

Viewing 12 replies - 46 through 57 (of 57 total)
  • Thread Starter rtpHarry

    (@rtpharry)

    SHORTCODE ISSUE

    It looks like you have removed a line.

    In \cherry-popups\includes\public\class-popups-template-callbacks.php at line 140 this line of code has been removed:

    $content = apply_filters( 'the_content', $content );

    Which breaks any templates that use shortcodes. Can this be added back in please?

    Thread Starter rtpHarry

    (@rtpharry)

    Ah it seems that this can be done with the save_post action, it doesn’t need support from the actual plugin:

    https://codex.www.ads-software.com/Plugin_API/Action_Reference/save_post

    As @tdgu said, you need to rename the filter so your first line should actually be:

    add_filter('cpto/interface_itme_data', 'theme_apto_reorder_item_additional_details', 10, 2);

    This will only show extra data on the “re-order” page.

    You should also write some custom columns code to surface this information in your main post indexes. Check out this https://code.tutsplus.com/articles/add-a-custom-column-in-posts-and-custom-post-types-admin-screen–wp-24934.

    Here is a complete example of both techniques that I used on a project I’m currently working on:

    
    // Add custom field to Exhibitor CPT index "FEATURED"
    // https://code.tutsplus.com/articles/add-a-custom-column-in-posts-and-custom-post-types-admin-screen--wp-24934
    function rtp_columns_head_only_exhibitor($defaults) {
        $defaults['is_featured'] = __('Featured Exhibitor?');
        return $defaults;
    }
    function rtp_columns_content_only_exhibitor($column_name, $post_ID) {
        if ($column_name == 'is_featured') {
            $is_featured = get_field('is_featured', $post_ID);
            if($is_featured) {
              echo '<span style="background-color: #D54E21; color: #fff; padding: 3px 5px; text-transform: uppercase;">' . __("Featured") . '</span>';
            } else {
              echo '<span style="background-color: #ddd; padding: 3px 5px; text-transform: uppercase;">' . __("Not Featured") . '</span>';
            }
        }
    }
    add_filter('manage_exhibitor_posts_columns', 'rtp_columns_head_only_exhibitor', 10);
    add_action('manage_exhibitor_posts_custom_column', 'rtp_columns_content_only_exhibitor', 10, 2);
    
    // Add custom notation to Reorder page by Post Types Order plugin
    function rtp_show_isfeatured_on_posttypesorder_page($item_details, $page) {
      if("exhibitor" == $page->post_type) {
        $is_featured = get_field('is_featured', $page->ID);
    
        $is_featured_snippet = '<span style="margin-right: 10px; background-color: #D54E21; color: #fff; padding: 3px 5px; text-transform: uppercase; display: inline;">' . __("Featured") . '</span>';
    
        if($is_featured){
          $item_details = $is_featured_snippet . $item_details;
        }
      }
    
      return $item_details;
    }
    add_filter('cpto/interface_itme_data', 'rtp_show_isfeatured_on_posttypesorder_page', 10, 2);
    

    This link was posted above but not really a big deal about it:

    WordPress Importer Redux

    You should check it out before reading any other solutions – it is a rewrite of the plugin which actually works and will become the official v2 of the plugin when its finished.

    This information should be pushed into the description of the official plugin as I ended up with a mess of data trying to figure out what was going wrong.

    Thread Starter rtpHarry

    (@rtpharry)

    Thanks for the prompt update.

    I had it in my todo list to take another look at it but when I went to investigate it a second time I realised it had already installed the new version, overwritten the resize modifications I’d made to the core files and had automatically started using the cycloneslider_image_sizes filter I’d tried to set up the first time.

    It’s not often you go to do a job and find that it’s already completed itself! haha

    Thread Starter rtpHarry

    (@rtpharry)

    Cory, thanks for the reply. It seems that I see it quite often with my development environment.

    My dev environment is based on VVV 1.2.0 which runs nginx on ubuntu 14.04 lts through a virtual box.

    You might be able to recreate the issue if you’re having trouble pinning it down by using this to scaffold a site?

    Thread Starter rtpHarry

    (@rtpharry)

    Actually this doesn’t completely solve the problem.

    It solves the resizing problem but then the admin pages all disappear, I guess that some of the init code does need to be run in the ‘plugins_loaded’ filter.

    Plugin Author rtpHarry

    (@rtpharry)

    It’s not documented but you can do this, if you leave an empty line where the slug goes it will automatically generate it based on the page title.

    This is because internally it will try to generate a page with an empty slug, WordPress will see that’s invalid and then provide a valid fallback post based on the page title.

    Thread Starter rtpHarry

    (@rtpharry)

    Yeah I agree, I’ve been digging around and it seems like its been a known issue for two years:

    https://core.trac.www.ads-software.com/ticket/23805#comment:3

    There is a one-liner which would fix it but it needs to be done in the core.

    Unless there is a way to override the ajax call in the admin panel and use your own I think you might just have to wait for WP to fix the bug.

    Thread Starter rtpHarry

    (@rtpharry)

    Looking at this some more it seems that it is a bug with WP that assumes there will only ever be three types of menu-item-type, or at least doesn’t check that the $_object exists before it tries to use it.

    I’m getting these errors as well.

    Looking at the code it seems pretty simple for the developers to fix.

    extract() will create a $var for each of the atts that are passed through. The error is occurring because it uses different names to store the css snippet than the original.

    Adding these three lines after $list = ‘ul’; on line 93 will “fix” it:

    $sub_menu_style = '';
    $submenu_anchor_color_style = '';
    $submenu_anchor_hover_color_style = '';

    However the code could certainly be optimised overall as that whole block of code creates redundant, empty blocks of CSS if the shortcode doesn’t override the colors, eg:

    <style>
    #short_menu_54e3303fddb73 {  }
    #short_menu_54e3303fddb73 ul.wpsm-arrow-enabled:before {  }
    #short_menu_54e3303fddb73 ul,
    #short_menu_54e3303fddb73 ul ul {  }
    #short_menu_54e3303fddb73 a {  }
    #short_menu_54e3303fddb73 a:hover {  }
    #short_menu_54e3303fddb73 ul a {  }
    #short_menu_54e3303fddb73 ul a:hover {  }
    </style>
    Thread Starter rtpHarry

    (@rtpharry)

    Aaaand I’ve instantly realised I should be using [nimble-portfolio] not [nimble_portfolio]…

Viewing 12 replies - 46 through 57 (of 57 total)