name, $excluded, true ) ) { continue; } // Skip WP private post types if ( $wp_post_type->_builtin && ! $wp_post_type->public ) { continue; } $post_types[] = array( 'value' => $wp_post_type->name, 'label' => $wp_post_type->labels->singular_name . ( ! in_array( $wp_post_type->name, $enabled, true ) ? ' ' . __( '(Pro+ version)', 'airwpsync' ) : '' ), 'enabled' => in_array( $wp_post_type->name, $enabled, true ), ); } $post_types[] = array( 'value' => 'custom', 'label' => __( 'Create new post type... (Pro+ version)', 'air-wp-sync' ), 'enabled' => false, ); return apply_filters( 'airwpsync/get_post_types', $post_types ); } /** * Get post stati */ public static function get_post_stati() { $whitelist = array( 'publish', 'future', 'draft', 'pending', 'trash', 'private' ); $post_stati = array(); $wp_post_stati = get_post_stati( array( 'internal' => false ), 'objects' ); foreach ( $wp_post_stati as $wp_post_status ) { $enabled = in_array( $wp_post_status->name, $whitelist, true ); $post_stati[] = array( 'value' => $wp_post_status->name, 'label' => $wp_post_status->label . ( ! $enabled ? ' ' . __( '(Pro+ version)', 'airwpsync' ) : '' ), 'enabled' => $enabled, ); } return apply_filters( 'airwpsync/get_post_stati', $post_stati ); } /** * Get post authors */ public static function get_post_authors() { $authors = array(); $wp_authors = get_users( array( 'role__in' => array( 'administrator', 'editor', 'author', 'contributor' ) ) ); foreach ( $wp_authors as $wp_author ) { $authors[] = array( 'value' => $wp_author->ID, 'label' => $wp_author->display_name, 'enabled' => true, ); } return apply_filters( 'airwpsync/get_post_authors', $authors ); } }