- 2.0.42 release;

This commit is contained in:
nikitasinelnikov
2019-03-28 14:54:12 +02:00
parent b83eaec05e
commit 7c860d0b07
7 changed files with 89 additions and 55 deletions
+11 -2
View File
@@ -429,7 +429,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Load Gutenberg blocks js
*/
function load_gutenberg_shortcode_blocks() {
if ( ! function_exists( 'register_block_type' ) ) {
// Gutenberg is not active.
return;
@@ -441,6 +440,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
return;
}
$enable_blocks = UM()->options()->get( 'enable_blocks' );
if ( empty( $enable_blocks ) ) {
return;
}
wp_register_script( 'um-blocks-shortcode-js', $this->js_url . 'um-admin-blocks-shortcode.js', array( 'wp-i18n', 'wp-blocks', 'wp-components' ), ultimatemember_version, true );
wp_set_script_translations( 'um-blocks-shortcode-js', 'ultimate-member' );
wp_enqueue_script( 'um-blocks-shortcode-js' );
@@ -499,7 +503,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* @return array
*/
function blocks_category( $categories, $post ) {
return array_merge(
$enable_blocks = UM()->options()->get( 'enable_blocks' );
if ( empty( $enable_blocks ) ) {
return $categories;
}
return array_merge(
$categories,
array(
array(