Skip to content

Commit

Permalink
fix: add wp-a11y dependency to scripts
Browse files Browse the repository at this point in the history
Restore manual translation management.
  • Loading branch information
greatislander committed Feb 27, 2020
1 parent 20d8ab3 commit 4cbd457
Showing 1 changed file with 1 addition and 130 deletions.
131 changes: 1 addition & 130 deletions includes/functions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ function setup() {
add_filter( 'mce_css', $n( 'mce_css' ) );
// Hook to allow async or defer on asset loading.
add_filter( 'script_loader_tag', $n( 'script_loader_tag' ), 10, 2 );
// Ensure resources and topics are translatable.
add_filter( 'pll_get_post_types', $n( 'add_resource_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_coop_type_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_sector_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_region_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_topic_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_goal_to_pll' ), 10, 2 );
add_filter( 'pll_get_taxonomies', $n( 'add_format_to_pll' ), 10, 2 );

// Disable inaccessible sortable JavaScript for term order.
add_filter( 'wp_fancy_term_order', '__return_false' );
Expand Down Expand Up @@ -137,23 +129,6 @@ function resource_init() {
);
}

/**
* Add the `lc_resource` post type to Polylang, ensuring it is translatable.
*
* @param array $post_types An array of post types.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_resource_to_pll( $post_types, $is_settings ) {
if ( $is_settings ) {
unset( $post_types['lc_resource'] );
} else {
$post_types['lc_resource'] = 'lc_resource';
}
return $post_types;
}

/**
* Registers the `lc_topic` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -202,23 +177,6 @@ function topic_init() {
);
}

/**
* Add the `lc_topic` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_topic_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_topic'] );
} else {
$taxonomies['lc_topic'] = 'lc_topic';
}
return $taxonomies;
}

/**
* Registers the `lc_goal` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -267,24 +225,6 @@ function goal_init() {
);
}

/**
* Add the `lc_goal` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_goal_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_goal'] );
} else {
$taxonomies['lc_goal'] = 'lc_goal';
}
return $taxonomies;
}


/**
* Registers the `lc_region` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -333,24 +273,6 @@ function region_init() {
);
}

/**
* Add the `lc_region` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_region_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_region'] );
} else {
$taxonomies['lc_region'] = 'lc_region';
}
return $taxonomies;
}


/**
* Registers the `lc_sector` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -399,23 +321,6 @@ function sector_init() {
);
}

/**
* Add the `lc_sector` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_sector_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_sector'] );
} else {
$taxonomies['lc_sector'] = 'lc_sector';
}
return $taxonomies;
}

/**
* Registers the `lc_sector` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -464,23 +369,6 @@ function coop_type_init() {
);
}

/**
* Add the `lc_coop_type` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_coop_type_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_coop_type'] );
} else {
$taxonomies['lc_coop_type'] = 'lc_coop_type';
}
return $taxonomies;
}

/**
* Registers the `lc_format` taxonomy,
* for use with 'lc_resource'.
Expand Down Expand Up @@ -529,23 +417,6 @@ function format_init() {
);
}

/**
* Add the `lc_format` taxonomy to Polylang, ensuring it is translatable.
*
* @param array $taxonomies An array of taxonomies.
* @param bool $is_settings Whether or not we are on the settings page.
*
* @return array
*/
function add_format_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['lc_format'] );
} else {
$taxonomies['lc_format'] = 'lc_format';
}
return $taxonomies;
}

/**
* Initializes the plugin and fires an action other plugins can hook into.
*
Expand Down Expand Up @@ -659,7 +530,7 @@ function admin_scripts() {
wp_enqueue_script(
'coop_library_framework_admin',
script_url( 'admin', 'admin' ),
[ 'wp-i18n' ],
[ 'wp-a11y', 'wp-i18n' ],
COOP_LIBRARY_FRAMEWORK_VERSION,
true
);
Expand Down

0 comments on commit 4cbd457

Please sign in to comment.