This topic has 5 replies, 3 voices, and was last updated 9 years by Abe.

  • Author
  • #32166
     chazzzzy
    Participant

    I use permissions to control what users can post, etc.. and i need to change your priority of your creation of Post Types in kleo//lib/post-types.php

    You currently have them as:

    COPY CODE
            add_action( 'init', array( &$this, 'setup_clients_post_type' ), 100	 );
            add_action( 'init', array( &$this, 'setup_testimonials_post_type' ), 100 );
            add_action( 'init', array( &$this, 'setup_portfolio_post_type' ), 100 );

    I need to change them to 49

    Problem is that you have not put a way for me to override the post-types actions in my child-theme.

    Do you know how to do it without me having to change the actual parent files?

    Normally you would put:

    if ( function_exists( 'setup_clients_post_type ()' ) ) {......

    in your actual parent template files, but you have not done that, so how can I override the priorities that you have set?

    Thanks!

    #32313
     sharmstr
    Moderator

    Normally you can remove the action, then readd the action with a different priority. http://stackoverflow.com/questions/12539947/how-can-i-change-action-priority-in-wordpress

    They are public functions, so maybe something like this will work? (you might have to play with it since they are in a class)

    remove_action( 'init', 'setup_clients_post_type', 100 );
    remove_action( 'init', 'setup_testimonials_post_type', 100 );
    remove_action( 'init', 'setup_portfolio_post_type', 100 );
    add_action( 'init', 'setup_clients_post_type', 49 );
    add_action( 'init', 'setup_testimonials_post_type', 49 );
    add_action( 'init', 'setup_portfolio_post_type', 49 );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #32474
     chazzzzy
    Participant

    Nothing works.. I can’t even remove the custom pages. Any idea how I can just remove them? The remove_action does not work at all.. and I’ve tried so many variants from googling things around the net.

    Thanks so much!

    Charles

    #32479
     Abe
    Keymaster

    Hi chazzzzy,
    This should work but you need to change a file that will be also included in next update. Add the code in your child theme.

    COPY CODE
    
    add_action( 'after_setup_theme', 'kleo_my_remove_actions' );
    function kleo_my_remove_actions()
    {
        global $kleo_post_types;
        remove_action('init', array( $kleo_post_types, 'setup_clients_post_type'), 100);
    }
    

    And change this file content from your theme: wp-content/themes/kleo/lib/theme-functions.php with the content from the one attached

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #33364
     chazzzzy
    Participant

    Abe, thank you again! Works perfectly!

    #33367
     Abe
    Keymaster

    Great 😉

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

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

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?