true, 'slug' => 'cosa', 'with_front' => false, ); } add_filter( 'et_project_posttype_rewrite_args', 'ft_divi_custom_post_name' ); //Ocultar el tipo de contenido Proyecto de Divi add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 ); function mytheme_et_project_posttype_args( $args ) { return array_merge( $args, array( 'public' => false, 'exclude_from_search' => false, 'publicly_queryable' => false, 'show_in_nav_menus' => false, 'show_ui' => false )); } ////Mostrar la REST API sólo a usuarios administradores add_filter( 'rest_authentication_errors', function( $result ) { if ( ! empty( $result ) ) { return $result; } if ( ! is_user_logged_in() ) { return new WP_Error( 'rest_not_logged_in', 'You are not currently logged in.', array( 'status' => 401 ) ); } if ( ! current_user_can( 'administrator' ) ) { return new WP_Error( 'rest_not_admin', 'You are not an administrator.', array( 'status' => 401 ) ); } return $result; });