Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • JOIT LLC.
    Participant

    Hi!

    Thank you for the great plugin.

    Custom Post Type ( name: shortcoder_editor ) looks like generate web pages.

    ▼ Screenshot in order
    https://ibb.co/FJswSD1
    https://ibb.co/51BCN0R
    https://ibb.co/rGSqqQ0
    https://ibb.co/hBM9tC7

    If I want to let CPT( shortcoder_editor ) not to generate web pages, do I have to add new code for 404 redirection at function.php?

    Do you have any other solutions?

    Hi Joit,

    Thanks for using Shortcoder plugin. Glad that you liked it.

    I understand the issue. The link is made available by WordPress for preview purposes. But seems it is accessible by public too.

    I’ll see what can be done here to avoid this issue.

    Thanks,
    Aakash

    JOIT LLC.
    Participant

    Hi, Aakash.
    Thank you for your quick reply.

    I appreciate your considering it positively.

    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

    I will write this kind of code at function.php until your update to this issue.

    
    function my_func_name() {
    	if( is_singular('shortcoder_editor') ){
    		global $wp_query;
    		$wp_query->set_404();
    		status_header(404);
    	}
    }
    add_action( 'template_redirect', 'my_func_name' );
    

    ※You need know you will not be able to access my web-page created by CPT(shortcoder_editor).

    I will wait looking forward to your update!

    Hi Joit,

    Thanks for the code. The reason the post has an URL is for the preview. In this case I need to ensure that preview is availble only for admins and not the public. I’m targetting a fix for WordPress 6.3. I’ll include this in that release.

    Thanks,
    Aakash

    JOIT LLC.
    Participant

    Hi, Aakash.

    Thank you for your additional information.

    I think the fix helps many people.

    Best regards.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter