Skip Navigation

[Resuelto] Custom status in post form

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 3 años, 4 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por jesusM-6 hace 3 años, 4 meses.

Asistido por: Shane.

Autor
Mensajes
#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

Idiomas: Inglés (English )

Zona horaria: 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!