• Resolved garikaib

    (@garikaib)


    I cannot get the short URL option to show up on my custom posts in the dashboard even though I have added the shortlinks option.I just see only sharing link options.

    
    function cptui_register_my_cpts_price_updates() {
    
    	/**
    	 * Post Type: Price Updates.
    	 */
    
    	$labels = [
    		"name" => __( "Price Updates", "Avada" ),
    		"singular_name" => __( "Price Update", "Avada" ),
    	];
    
    	$args = [
    		"label" => __( "Price Updates", "Avada" ),
    		"labels" => $labels,
    		"description" => "Current Price Tables",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"delete_with_user" => false,
    		"exclude_from_search" => false,
    		"capability_type" => "page",
    		"map_meta_cap" => true,
    		"hierarchical" => true,
    		"rewrite" => [ "slug" => "price-updates", "with_front" => true ],
    		"query_var" => true,
    		"menu_icon" => "dashicons-clipboard",
    		"supports" => [ "title", "editor", "thumbnail", "author", "post-formats", "publicize", "shortlinks", "show_in_rest" ],
    		"taxonomies" => [ "price_update_categories" ],
    	];
    
    	register_post_type( "price_updates", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts_price_updates' );

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support darnelldibbles

    (@darnelldibbles)

    Hi there,

    Was it the shortlinks option for custom post types that you added? Have you tried adding the add_post_type_support() function via the Jetpack support page?

    add_action('init', 'my_custom_init');
    function my_custom_init() {
        add_post_type_support( 'product', 'shortlinks' );
    }

    This is to enable shortlinks custom post types to custom post types.

    https://jetpack.com/support/wp-me-shortlinks/

    Let me know if that works for you.

    Thanks,

    Thread Starter garikaib

    (@garikaib)

    Hi,

    Thanks for the tip but I had already tried that as well. And again it didn’t work https://imgur.com/UexJYAv that’s the screenshot.

    Plugin Support darnelldibbles

    (@darnelldibbles)

    Thanks for the update. Please reach out to Jetpack support via our contact form and see if we can look further into this for you:

    https://jetpack.com/contact-support/

    Thanks,

    Thread Starter garikaib

    (@garikaib)

    According to Tracy @automattic, you guys have such a backlog there is not time to support non-paying customers or answer their questions. It has been a while since

    We only support the plugin features as they were designed. Customizations around custom posts and creating custom functions support is provided in the forums:

    I understand and appreciate that’s why I had started my question here. In the hope that someone not necessarily you guys could help me with this. Can you guys please remove the solved label maybe some Good Samaritan will come across this and help me resolve it.

    Plugin Support KokkieH

    (@kokkieh)

    I’ve unresolved the thread for now, but as a rule this plugin forum don’t get a lot of replies from non-Jetpack staff, so it’s not very likely you’ll get a solution from a random passerby here. A coding forum like wordpress.stackexchange.com might be a better bet for you.

    That said, I did notice something in your code (though I’m not a developer so this might not be relevant:

    In your last line where you hook into the init action you have it as so:

    add_action( 'init', 'cptui_register_my_cpts_price_updates' );

    But in our support page that Darnell linked to above, the correct code is indicated as so:

    add_action( 'init', 'custom_post_type', 0 );

    In other words, you are missing the , 0 after the name of the function you’re calling. Can you see if adding that perhaps makes your custom code work?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Short URL not showing up on custom posts’ is closed to new replies.