@@ -18,27 +18,27 @@ |
||
| 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.13.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.13.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 | |
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - // new ajax function to lock post for editing |
|
| 258 | + // new ajax function to lock post for editing |
|
| 259 | 259 | public function editus_lock_post() |
| 260 | 260 | { |
| 261 | 261 | $post_id= $_POST["postid"]; |
| 262 | 262 | $locked = wp_check_post_lock($post_id); |
| 263 | 263 | |
| 264 | 264 | if (!$locked) { |
| 265 | - wp_set_post_lock($post_id); |
|
| 265 | + wp_set_post_lock($post_id); |
|
| 266 | 266 | echo "true"; |
| 267 | 267 | } else { |
| 268 | 268 | $user_info = get_userdata($locked); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | ); |
| 282 | 282 | foreach ($_POST as $key => $value) { |
| 283 | 283 | if ($key !="code" && $key !="action") { |
| 284 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
| 284 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
| 285 | 285 | $atts[$key] = $value; |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -291,37 +291,37 @@ discard block |
||
| 291 | 291 | }*/ |
| 292 | 292 | |
| 293 | 293 | if ($code == "aesop_image") { |
| 294 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 295 | - echo aesop_image_shortcode($atts); |
|
| 294 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 295 | + echo aesop_image_shortcode($atts); |
|
| 296 | 296 | } |
| 297 | 297 | if ($code == "aesop_quote") { |
| 298 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 299 | - echo aesop_quote_shortcode($atts); |
|
| 298 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 299 | + echo aesop_quote_shortcode($atts); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | if ($code == "aesop_parallax") { |
| 303 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 304 | - echo aesop_parallax_shortcode($atts); |
|
| 303 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 304 | + echo aesop_parallax_shortcode($atts); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | if ($code == "aesop_character") { |
| 308 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 309 | - echo aesop_character_shortcode($atts); |
|
| 308 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 309 | + echo aesop_character_shortcode($atts); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | if ($code == "aesop_collection") { |
| 313 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 314 | - echo aesop_collection_shortcode($atts); |
|
| 313 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 314 | + echo aesop_collection_shortcode($atts); |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if ($code == "aesop_chapter") { |
| 318 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 319 | - echo aesop_chapter_shortcode($atts); |
|
| 318 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 319 | + echo aesop_chapter_shortcode($atts); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if ($code == "aesop_gallery") { |
| 323 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 324 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 323 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 324 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | exit; |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
| 53 | 53 | |
| 54 | 54 | // Activate plugin when new blog is added |
| 55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
| 55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
| 56 | 56 | |
| 57 | 57 | // Load plugin text domain |
| 58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
| 59 | 59 | |
| 60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
| 61 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
| 60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
| 61 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
| 62 | 62 | |
| 63 | 63 | //enqueue assets |
| 64 | 64 | new assets(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public static function get_instance() { |
| 87 | 87 | |
| 88 | 88 | // If the single instance hasn't been set, set it now. |
| 89 | - if ( null == self::$instance ) { |
|
| 89 | + if (null == self::$instance) { |
|
| 90 | 90 | self::$instance = new self; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -103,18 +103,18 @@ discard block |
||
| 103 | 103 | * WPMU is disabled or plugin is |
| 104 | 104 | * activated on an individual blog. |
| 105 | 105 | */ |
| 106 | - public static function activate( $network_wide ) { |
|
| 106 | + public static function activate($network_wide) { |
|
| 107 | 107 | |
| 108 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 108 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 109 | 109 | |
| 110 | - if ( $network_wide ) { |
|
| 110 | + if ($network_wide) { |
|
| 111 | 111 | |
| 112 | 112 | // Get all blog ids |
| 113 | 113 | $blog_ids = self::get_blog_ids(); |
| 114 | 114 | |
| 115 | - foreach ( $blog_ids as $blog_id ) { |
|
| 115 | + foreach ($blog_ids as $blog_id) { |
|
| 116 | 116 | |
| 117 | - switch_to_blog( $blog_id ); |
|
| 117 | + switch_to_blog($blog_id); |
|
| 118 | 118 | self::single_activate(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -140,18 +140,18 @@ discard block |
||
| 140 | 140 | * WPMU is disabled or plugin is |
| 141 | 141 | * deactivated on an individual blog. |
| 142 | 142 | */ |
| 143 | - public static function deactivate( $network_wide ) { |
|
| 143 | + public static function deactivate($network_wide) { |
|
| 144 | 144 | |
| 145 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 145 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 146 | 146 | |
| 147 | - if ( $network_wide ) { |
|
| 147 | + if ($network_wide) { |
|
| 148 | 148 | |
| 149 | 149 | // Get all blog ids |
| 150 | 150 | $blog_ids = self::get_blog_ids(); |
| 151 | 151 | |
| 152 | - foreach ( $blog_ids as $blog_id ) { |
|
| 152 | + foreach ($blog_ids as $blog_id) { |
|
| 153 | 153 | |
| 154 | - switch_to_blog( $blog_id ); |
|
| 154 | + switch_to_blog($blog_id); |
|
| 155 | 155 | self::single_deactivate(); |
| 156 | 156 | |
| 157 | 157 | } |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @param int $blog_id ID of the new blog. |
| 177 | 177 | */ |
| 178 | - public function activate_new_site( $blog_id ) { |
|
| 178 | + public function activate_new_site($blog_id) { |
|
| 179 | 179 | |
| 180 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
| 180 | + if (1 !== did_action('wpmu_new_blog')) { |
|
| 181 | 181 | return; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - switch_to_blog( $blog_id ); |
|
| 184 | + switch_to_blog($blog_id); |
|
| 185 | 185 | self::single_activate(); |
| 186 | 186 | restore_current_blog(); |
| 187 | 187 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | WHERE archived = '0' AND spam = '0' |
| 207 | 207 | AND deleted = '0'"; |
| 208 | 208 | |
| 209 | - return $wpdb->get_col( $sql ); |
|
| 209 | + return $wpdb->get_col($sql); |
|
| 210 | 210 | |
| 211 | 211 | } |
| 212 | 212 | |
@@ -217,18 +217,18 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | private static function single_activate() { |
| 219 | 219 | |
| 220 | - $curr_version = get_option( 'lasso_version' ); |
|
| 220 | + $curr_version = get_option('lasso_version'); |
|
| 221 | 221 | |
| 222 | 222 | // update upgraded from |
| 223 | - if ( $curr_version ) { |
|
| 224 | - update_option( 'lasso_updated_from', $curr_version ); |
|
| 223 | + if ($curr_version) { |
|
| 224 | + update_option('lasso_updated_from', $curr_version); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // update lasso version option |
| 228 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
| 228 | + update_option('lasso_version', LASSO_VERSION); |
|
| 229 | 229 | |
| 230 | 230 | // set transietn for activation welcome |
| 231 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
| 231 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
| 232 | 232 | |
| 233 | 233 | |
| 234 | 234 | } |
@@ -250,15 +250,15 @@ discard block |
||
| 250 | 250 | public function load_plugin_textdomain() { |
| 251 | 251 | |
| 252 | 252 | $domain = $this->plugin_slug; |
| 253 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
| 253 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
| 254 | 254 | |
| 255 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
| 255 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | // new ajax function to lock post for editing |
| 259 | 259 | public function editus_lock_post() |
| 260 | 260 | { |
| 261 | - $post_id= $_POST["postid"]; |
|
| 261 | + $post_id = $_POST["postid"]; |
|
| 262 | 262 | $locked = wp_check_post_lock($post_id); |
| 263 | 263 | |
| 264 | 264 | if (!$locked) { |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | echo "true"; |
| 267 | 267 | } else { |
| 268 | 268 | $user_info = get_userdata($locked); |
| 269 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
| 269 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
| 270 | 270 | } |
| 271 | 271 | exit; |
| 272 | 272 | } |
@@ -276,11 +276,11 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | |
| 278 | 278 | |
| 279 | - $code= $_POST["code"]; |
|
| 279 | + $code = $_POST["code"]; |
|
| 280 | 280 | $atts = array( |
| 281 | 281 | ); |
| 282 | 282 | foreach ($_POST as $key => $value) { |
| 283 | - if ($key !="code" && $key !="action") { |
|
| 283 | + if ($key != "code" && $key != "action") { |
|
| 284 | 284 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
| 285 | 285 | $atts[$key] = $value; |
| 286 | 286 | } |
@@ -291,37 +291,37 @@ discard block |
||
| 291 | 291 | }*/ |
| 292 | 292 | |
| 293 | 293 | if ($code == "aesop_image") { |
| 294 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 294 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 295 | 295 | echo aesop_image_shortcode($atts); |
| 296 | 296 | } |
| 297 | 297 | if ($code == "aesop_quote") { |
| 298 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 298 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 299 | 299 | echo aesop_quote_shortcode($atts); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | if ($code == "aesop_parallax") { |
| 303 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 303 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 304 | 304 | echo aesop_parallax_shortcode($atts); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | if ($code == "aesop_character") { |
| 308 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 308 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 309 | 309 | echo aesop_character_shortcode($atts); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | if ($code == "aesop_collection") { |
| 313 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 313 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 314 | 314 | echo aesop_collection_shortcode($atts); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if ($code == "aesop_chapter") { |
| 318 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 318 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 319 | 319 | echo aesop_chapter_shortcode($atts); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if ($code == "aesop_gallery") { |
| 323 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 324 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 323 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 324 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | exit; |