• Hi,

    clicking the delete link for an Active URL doesn’t remove the URL from the list. I believe this is because there’s no _edit_link index specified in the following call to register_post_type():

    protected function postTypes() {
    	register_post_type($this->postTypeId,
    		array(
    			'labels'              => array(
    				'name'               => __('Autoload URL', 'icwoo'),
    			),
    			'public'              => false,
    			'exclude_from_search' => true,
    			'hierarchical'        => false,
    			'has_archive'         => false,
    			'show_in_nav_menus'   => false,
    			'supports'            => array('title')
    		)
    	);		
    }

    Consequently, in WordPress’s get_delete_post_link() function, the post ID isn’t added to the link. For wp_post_type ‘post’, for example, _edit_link is post.php?post=%d. Is this something to do with user capabilities? Do I need to add a user capability to edit posts with type ‘icwoo-url’?

    Thanks,

    Tommy

Viewing 1 replies (of 1 total)
  • Thread Starter hatchjaw

    (@hatchjaw)

    On further inspection it looks like the issue is due to this snippet from `set_props()’ in class_wp_post_type.php:

    // If there's no specified edit link and no UI, remove the edit link.
    if ( ! $args['show_ui'] && ! $has_edit_link ) {
    	$args['_edit_link'] = '';
    }

    the show_ui index takes the value from public, which is false, so the edit link is set to ”. Can you suggest a workaround?

Viewing 1 replies (of 1 total)

The topic ‘Delete link doesn’t work’ is closed to new replies.