Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cut 'post' #57

Open
mmjaeger opened this issue Feb 14, 2016 · 5 comments
Open

cut 'post' #57

mmjaeger opened this issue Feb 14, 2016 · 5 comments
Labels

Comments

@mmjaeger
Copy link

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

@jjgrainger
Copy link
Owner

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

@mmjaeger
Copy link
Author

thanks for replying Joe - unfortunately, the code above doesn't do anything.

On Tue, Feb 16, 2016 at 4:31 AM, Joe Grainger notifications@github.com
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
#57 (comment)
.

Marco M. Jaeger
http://net4visions.com

@QWp6t
Copy link

QWp6t commented Feb 16, 2016

Well, it answers your question: Nope. Not possible. 👍

@mmjaeger
Copy link
Author

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.

@jjgrainger
Copy link
Owner

@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 jjgrainger added the bug label Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants