@@ -57,8 +57,8 @@ |
||
| 57 | 57 | if( !$wp_post_types[$key] ) |
| 58 | 58 | continue; |
| 59 | 59 | |
| 60 | - $wp_post_types[$key]->show_in_rest = true; |
|
| 61 | - } |
|
| 60 | + $wp_post_types[$key]->show_in_rest = true; |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | add_action( 'init', 'lasso_show_in_rest' ); |
@@ -18,27 +18,27 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | // If this file is called directly, abort. |
| 21 | -if ( ! defined( 'WPINC' ) ) { |
|
| 21 | +if (!defined('WPINC')) { |
|
| 22 | 22 | die; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Set some constants |
| 26 | -define( 'LASSO_VERSION', '0.9.15.0' ); |
|
| 27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
| 28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
| 29 | -define( 'LASSO_FILE', __FILE__ ); |
|
| 26 | +define('LASSO_VERSION', '0.9.15.0'); |
|
| 27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
| 28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
| 29 | +define('LASSO_FILE', __FILE__); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Load plugin if PHP version is 5.4 or later. |
| 33 | 33 | */ |
| 34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
| 34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
| 35 | 35 | |
| 36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
| 36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
| 37 | 37 | |
| 38 | 38 | } else { |
| 39 | 39 | |
| 40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
| 41 | - function lasso_fail_notice(){ |
|
| 41 | + function lasso_fail_notice() { |
|
| 42 | 42 | |
| 43 | 43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
| 44 | 44 | |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | function lasso_show_in_rest() { |
| 49 | 49 | global $wp_post_types; |
| 50 | 50 | |
| 51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
| 52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
| 51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
| 52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
| 53 | 53 | |
| 54 | - foreach( $allowed_post_types as $key ) { |
|
| 54 | + foreach ($allowed_post_types as $key) { |
|
| 55 | 55 | |
| 56 | 56 | // If the post type doesn't exist, skip it |
| 57 | - if( !$wp_post_types[$key] ) |
|
| 57 | + if (!$wp_post_types[$key]) |
|
| 58 | 58 | continue; |
| 59 | 59 | |
| 60 | 60 | $wp_post_types[$key]->show_in_rest = true; |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - add_action( 'init', 'lasso_show_in_rest' ); |
|
| 64 | + add_action('init', 'lasso_show_in_rest'); |
|
| 65 | 65 | |
@@ -54,8 +54,9 @@ |
||
| 54 | 54 | foreach( $allowed_post_types as $key ) { |
| 55 | 55 | |
| 56 | 56 | // If the post type doesn't exist, skip it |
| 57 | - if( !$wp_post_types[$key] ) |
|
| 58 | - continue; |
|
| 57 | + if( !$wp_post_types[$key] ) { |
|
| 58 | + continue; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | $wp_post_types[$key]->show_in_rest = true; |
| 61 | 62 | } |