'cpt', 'title' => __( 'Custom post types and Taxonomies', 'polylang' ), 'description' => __( 'Activate the languages and translations management for the custom post types and taxonomies.', 'polylang' ), ) ); // FIXME should be OK when the modules will be loaded from the settings page $post_types = get_post_types( array( 'public' => true, '_builtin' => false ) ); $post_types = array_diff( $post_types, get_post_types( array( '_pll' => true ) ) ); /** This filter is documented in include/model.php */ $this->post_types = array_unique( apply_filters( 'pll_get_post_types', $post_types, true ) ); $taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ) ); $taxonomies = array_diff( $taxonomies, get_taxonomies( array( '_pll' => true ) ) ); /** This filter is documented in include/model.php */ $this->taxonomies = array_unique( apply_filters( 'pll_get_taxonomies', $taxonomies , true ) ); } /** * tells if the module is active * * @since 1.8 * * @return bool */ public function is_active() { return ! empty( $this->post_types ) || ! empty( $this->taxonomies ); } /** * displays the settings form * * @since 1.8 */ protected function form() { if ( ! empty( $this->post_types ) ) {?>