This topic has 5 replies, 2 voices, and was last updated 8 years by clyn.

  • Author
  • #100741
     clyn
    Participant

    i can see the requiere membership metabox on add new post or page, how can add for specific custom post types. I check the lib/metabox.php but cant see there…

    second; i want to hide post visibility and save draft so i found this code and working… This code can create any problem in the future

    COPY CODE
    function wpse_36118_force_published( $post ) {
        if( 'trash' !== $post[ 'post_status' ] ) { /* We still want to use the trash */
            if( in_array( $post[ 'post_type' ], array( 'page', 'my_custom_post_type' ) ) ) {
                $post['post_status'] = 'publish';
            }
            return $post;
        }
    }
    
    // Hook to wp_insert_post_data
    add_filter( 'wp_insert_post_data', 'wpse_36118_force_published' );
    #100747
     sharmstr
    Moderator

    See this: http://www.paidmembershipspro.com/add-pmpro-membership-level-meta-box-to-a-custom-post-type/ Change the cpt name.

    I cant read that code. Its up to you to figure out if its going to cause issues since it custom code.

    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

    #100754
     clyn
    Participant

    oh sorry

    function wpse_36118_force_published( $post ) { if( ‘trash’ !== $post[ ‘post_status’ ] ) { /* We still want to use the trash */ if( in_array( $post[ ‘post_type’ ], array( ‘page’, ‘MYPOSTTYPES’ ) ) ) { $post[‘post_status’] = ‘publish’; } return $post; } } // Hook to wp_insert_post_data add_filter( ‘wp_insert_post_data’, ‘wpse_36118_force_published’ );

    #100768
     clyn
    Participant

    ProM code working very well on my custom post type. Showing login or register buttons but login button goes to wp-login.php not open pop-up at same window, and register button go to register page and i dont want to use this page (i am using Promembership register page)

    how can i change ths buttons URL’s

    thanks

    #100774
     sharmstr
    Moderator

    In the PMPro settings (advanced). You can make anything launch the login modal by adding the kleo-show-login class to it. Its in the Kleo documentation.

    Please read the documentation so you understand how to use PMPro. http://www.paidmembershipspro.com/documentation/

    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

    #100777
     clyn
    Participant

    ok thanks…

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

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?