cptui_do_convert_post_type_posts

Handle the conversion of post type posts.

Description

cptui_do_convert_post_type_posts(); 

This function came to be because we needed to convert AFTER registration.


Usage

  1. if ( !function_exists( 'cptui_do_convert_post_type_posts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/post-types.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_do_convert_post_type_posts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/post-types.php  
  1. function cptui_do_convert_post_type_posts() { 
  2.  
  3. /** 
  4. * Whether or not to convert post type posts. 
  5. * @since 1.4.3 
  6. * @param bool $value Whether or not to convert. 
  7. */ 
  8. if ( apply_filters( 'cptui_convert_post_type_posts', false ) ) { 
  9. cptui_convert_post_type_posts( sanitize_text_field( $_POST['cpt_original'] ), sanitize_text_field( $_POST['cpt_custom_post_type']['name'] ) );