wp-custom-post-type-class icon indicating copy to clipboard operation
wp-custom-post-type-class copied to clipboard

cut 'post'

Open mmjaeger opened this issue 9 years ago • 5 comments

Hello I was wondering whether it is possible to set the menu_position of the cpt 'post'?

mmjaeger avatar Feb 14 '16 21:02 mmjaeger

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

jjgrainger avatar Feb 16 '16 11:02 jjgrainger

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

mmjaeger avatar Feb 16 '16 15:02 mmjaeger

Well, it answers your question: Nope. Not possible. :+1:

QWp6t avatar Feb 16 '16 18:02 QWp6t

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 avatar Feb 16 '16 21:02 mmjaeger

@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.

jjgrainger avatar Apr 05 '16 11:04 jjgrainger