Skip Navigation

[Résolu] Custom status in post form

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

The issue here is that the user's custom post status created with PHP isn't showing up in the Forms status option.

Solution:

In this user's case they didn't add the following lines to their function

'show_in_admin_all_list'    => true,
      'show_in_admin_status_list' => true,

These lines are required for the custom status to show up as an option in our Forms plugin.

This support ticket is created Il y a 2 années et 8 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 réponses, has 2 voix.

Last updated by jesusM-6 Il y a 2 années et 8 mois.

Assisted by: Shane.

Auteur
Publications
#2115241
soporte toolset 01.jpg

I have registered 2 new status in wordpress with the following code:

if ( ! function_exists('creado_status') ) {
// Register Custom Status
function creado_status() {
$args = array(
'label' => _x( 'creado', 'Status General Name', 'text_domain' ),
'label_count' => _n_noop( 'creado (%s)', 'creados (%s)', 'text_domain' ),
);
register_post_status( 'creado', $args );
}
add_action( 'init', 'creado_status', 0 );
}

if ( ! function_exists('aceptado_status') ) {
// Register Custom Status
function aceptado_status() {
$args = array(
'label' => _x( 'aceptado', 'Status General Name', 'text_domain' ),
'label_count' => _n_noop( 'aceptado (%s)', 'aceptados (%s)', 'text_domain' ),
);
register_post_status( 'aceptado', $args );
}
add_action( 'init', 'aceptado_status', 0 );
}

But I can't see them in the list

#2115579

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I tried to register a custom post status with the code below and it work fine.


function wpdocs_custom_post_status(){
    register_post_status( 'unread', array(
        'label'                     => _x( 'Unread', 'post' ),
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Unread <span class="count">(%s)</span>', 'Unread <span class="count">(%s)</span>' ),
    ) );
}
add_action( 'init', 'wpdocs_custom_post_status' );

Checking on your code it would appear that you are missing these 2 lines

  'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,

These lines are what make the custom status appear in the list.

Thanks,
Shane

#2116359

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.