wp-custom-post-type-class
wp-custom-post-type-class copied to clipboard
cut 'post'
Hello I was wondering whether it is possible to set the menu_position of the cpt 'post'?
It should be? you can use the CPT class to access the default post type but I don't know about setting a new menu position.
You could try the following, though its untested.
$default_posts = new CPT('post', array(
'menu_position' => 10
));
the menu position comes from the arguements you would normally supply to register_post_type
, you find out more here http://codex.wordpress.org/Function_Reference/register_post_type
thanks for replying Joe - unfortunately, the code above doesn't do anything.
On Tue, Feb 16, 2016 at 4:31 AM, Joe Grainger [email protected] wrote:
It should be? you can use the CPT class to access the default post type but I don't know about setting a new menu position.
You could try the following, though its untested.
$default_posts = new CPT('post', array( 'menu_position' => 10));
the menu position comes from the arguements you would normally supply to register_post_type, you find out more here http://codex.wordpress.org/Function_Reference/register_post_type
— Reply to this email directly or view it on GitHub https://github.com/jjgrainger/wp-custom-post-type-class/issues/57#issuecomment-184643171 .
Marco M. Jaeger http://net4visions.com
Well, it answers your question: Nope. Not possible. :+1:
In this regard, I tried the following:
$cpt = new CPT('post');
// Define the columns to appear on the admin edit screen
$cpt->columns(array(
'cb' => '<input type="checkbox" />',
'title' => __('Title'),
'post_text' => __('Text'),
'post_publisher' => __('Publisher'),
'post_url' => __('Url'),
'category' => __('Categories'),
'post_tag' => __('Tags'),
'post_attachment' => __('Attachments'),
'date' => __('Date')
));
However, in the admin listings, category terms and tag terms appear twice - any idea why?
Thanks again.
@mmjaeger sorry for the late reply,
The class adds the categories and tags columns automatically if its the post
post type.
There was a reason why but I'll have to rethink this, as it removes control from the developer which isn't ideal.