/home/techb158/dev.aleamaralawal.com/wp-content/plugins/polylang/src/settings
Edit: /home/techb158/dev.aleamaralawal.com/wp-content/plugins/polylang/src/settings/settings-cpt.php (5250B)
'cpt',
'title' => __( 'Custom post types and Taxonomies', 'polylang' ),
'description' => __( 'Activate languages and translations management for the custom post types and the taxonomies.', 'polylang' ),
)
);
$public_post_types = get_post_types( array( 'public' => true, '_builtin' => false ) );
/** This filter is documented in src/model.php */
$this->post_types = array_unique( apply_filters( 'pll_get_post_types', $public_post_types, true ) );
/** This filter is documented in src/model.php */
$programmatically_active_post_types = array_unique( apply_filters( 'pll_get_post_types', array(), false ) );
$this->disabled_post_types = array_intersect( $programmatically_active_post_types, $this->post_types );
$public_taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ) );
$public_taxonomies = array_diff( $public_taxonomies, get_taxonomies( array( '_pll' => true ) ) );
/** This filter is documented in src/model.php */
$this->taxonomies = array_unique( apply_filters( 'pll_get_taxonomies', $public_taxonomies, true ) );
/** This filter is documented in src/model.php */
$programmatically_active_taxonomies = array_unique( apply_filters( 'pll_get_taxonomies', array(), false ) );
$this->disabled_taxonomies = array_intersect( $programmatically_active_taxonomies, $this->taxonomies );
}
/**
* 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 ) ) {?>
post_types as $post_type ) {
$pt = get_post_type_object( $post_type );
if ( ! empty( $pt ) ) {
$disabled = in_array( $post_type, $this->disabled_post_types );
printf(
'',
esc_attr( $post_type ),
checked( $disabled || in_array( $post_type, $this->options['post_types'], true ), true, false ),
disabled( $disabled, true, false ),
esc_html(
sprintf(
/* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */
_x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ),
$pt->labels->name,
$pt->name
)
)
);
}
}
?>
taxonomies ) ) {
?>
taxonomies as $taxonomy ) {
$tax = get_taxonomy( $taxonomy );
if ( ! empty( $tax ) ) {
$disabled = in_array( $taxonomy, $this->disabled_taxonomies );
printf(
'',
esc_attr( $taxonomy ),
checked( $disabled || in_array( $taxonomy, $this->options['taxonomies'], true ), true, false ),
disabled( $disabled, true, false ),
esc_html(
sprintf(
/* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */
_x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ),
$tax->labels->name,
$tax->name
)
)
);
}
}
?>