@@ -10,15 +10,15 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class assets { |
| 12 | 12 | |
| 13 | - public function __construct(){ |
|
| 13 | + public function __construct() { |
|
| 14 | 14 | |
| 15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
| 15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function scripts(){ |
|
| 18 | + public function scripts() { |
|
| 19 | 19 | |
| 20 | 20 | |
| 21 | - if ( lasso_user_can('edit_posts')) { |
|
| 21 | + if (lasso_user_can('edit_posts')) { |
|
| 22 | 22 | |
| 23 | 23 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
| 24 | 24 | |
@@ -33,27 +33,27 @@ discard block |
||
| 33 | 33 | // url for json api |
| 34 | 34 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
| 35 | 35 | |
| 36 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
| 36 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
| 37 | 37 | |
| 38 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
| 38 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
| 39 | 39 | |
| 40 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
| 41 | - if (empty( $featImgClass )) { |
|
| 40 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
| 41 | + if (empty($featImgClass)) { |
|
| 42 | 42 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
| 43 | 43 | } |
| 44 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
| 45 | - if (empty( $titleClass )) { |
|
| 44 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
| 45 | + if (empty($titleClass)) { |
|
| 46 | 46 | $titleClass = lasso_get_supported_theme_title_class(); |
| 47 | 47 | } |
| 48 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 49 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
| 48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 49 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
| 50 | 50 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
| 51 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
| 51 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
| 52 | 52 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
| 53 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
| 53 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
| 54 | 54 | |
| 55 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
| 56 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
| 55 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
| 56 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | //text alignement |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if ($show_color) { |
| 66 | 66 | //color picker |
| 67 | - wp_enqueue_style( 'wp-color-picker' ); |
|
| 68 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
| 67 | + wp_enqueue_style('wp-color-picker'); |
|
| 68 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // custom fields |
| 72 | 72 | |
| 73 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
| 73 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | |
@@ -81,60 +81,60 @@ discard block |
||
| 81 | 81 | $delta = time() - $post_date; |
| 82 | 82 | |
| 83 | 83 | $strings = array( |
| 84 | - 'save' => __('Save','lasso'), |
|
| 85 | - 'saving' => __('Saving...','lasso'), |
|
| 86 | - 'saved' => __('Saved!','lasso'), |
|
| 87 | - 'adding' => __('Adding...','lasso'), |
|
| 88 | - 'added' => __('Added!','lasso'), |
|
| 89 | - 'loading' => __('Loading...','lasso'), |
|
| 90 | - 'loadMore' => __('Load More','lasso'), |
|
| 91 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
| 92 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
| 93 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
| 94 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
| 95 | - 'justWrite' => __('Just write...','lasso'), |
|
| 96 | - 'chooseImage' => __('Choose an image','lasso'), |
|
| 97 | - 'updateImage' => __('Update Image','lasso'), |
|
| 98 | - 'insertImage' => __('Insert Image','lasso'), |
|
| 99 | - 'selectImage' => __('Select Image','lasso'), |
|
| 100 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
| 101 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
| 102 | - 'chooseImages' => __('Choose images','lasso'), |
|
| 103 | - 'editImage' => __('Edit Image','lasso'), |
|
| 104 | - 'addImages' => __('Add Images','lasso'), |
|
| 105 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
| 106 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
| 107 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
| 108 | - 'publishPost' => __('Publish Post?','lasso'), |
|
| 109 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
| 110 | - 'deletePost' => __('Trash Post?','lasso'), |
|
| 111 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
| 112 | - 'warning' => __('Oh snap!','laso'), |
|
| 113 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
| 114 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
| 84 | + 'save' => __('Save', 'lasso'), |
|
| 85 | + 'saving' => __('Saving...', 'lasso'), |
|
| 86 | + 'saved' => __('Saved!', 'lasso'), |
|
| 87 | + 'adding' => __('Adding...', 'lasso'), |
|
| 88 | + 'added' => __('Added!', 'lasso'), |
|
| 89 | + 'loading' => __('Loading...', 'lasso'), |
|
| 90 | + 'loadMore' => __('Load More', 'lasso'), |
|
| 91 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
| 92 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
| 93 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
| 94 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
| 95 | + 'justWrite' => __('Just write...', 'lasso'), |
|
| 96 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
| 97 | + 'updateImage' => __('Update Image', 'lasso'), |
|
| 98 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
| 99 | + 'selectImage' => __('Select Image', 'lasso'), |
|
| 100 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
| 101 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
| 102 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
| 103 | + 'editImage' => __('Edit Image', 'lasso'), |
|
| 104 | + 'addImages' => __('Add Images', 'lasso'), |
|
| 105 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
| 106 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
| 107 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
| 108 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
| 109 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
| 110 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
| 111 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
| 112 | + 'warning' => __('Oh snap!', 'laso'), |
|
| 113 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
| 114 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
| 115 | 115 | 'missingConfirm' => __('Update Settings', 'lasso'), |
| 116 | - 'helperText' => __('one more letter','lasso'), |
|
| 116 | + 'helperText' => __('one more letter', 'lasso'), |
|
| 117 | 117 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
| 120 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
| 121 | 121 | |
| 122 | 122 | $gallery_class = new gallery(); |
| 123 | 123 | $gallery_nonce_action = $gallery_class->nonce_action; |
| 124 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
| 124 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
| 125 | 125 | |
| 126 | 126 | // rest api |
| 127 | 127 | $rest_nonce = ''; |
| 128 | - $rest_root =''; |
|
| 128 | + $rest_root = ''; |
|
| 129 | 129 | if (function_exists('rest_url')) { |
| 130 | - $rest_root = esc_url_raw( rest_url()); |
|
| 131 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
| 132 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
| 133 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
| 134 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
| 135 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
| 130 | + $rest_root = esc_url_raw(rest_url()); |
|
| 131 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
| 132 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
| 133 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
| 134 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
| 135 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
| 136 | 136 | |
| 137 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
| 137 | + if (class_exists('WP_REST_Controller')) { |
|
| 138 | 138 | // we are using REST API V2 |
| 139 | 139 | $using_restapiv2 = true; |
| 140 | 140 | } |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | // localized objects |
| 144 | 144 | $objects = array( |
| 145 | - 'ajaxurl' => esc_url( $api_url ), |
|
| 146 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
| 145 | + 'ajaxurl' => esc_url($api_url), |
|
| 146 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
| 147 | 147 | 'rest_root' => $rest_root, |
| 148 | 148 | 'rest_nonce' => $rest_nonce, |
| 149 | 149 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | 'featImgClass' => $featImgClass, |
| 152 | 152 | 'titleClass' => $titleClass, |
| 153 | 153 | 'strings' => $strings, |
| 154 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
| 155 | - 'post_status' => get_post_status( $postid ), |
|
| 154 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
| 155 | + 'post_status' => get_post_status($postid), |
|
| 156 | 156 | 'postid' => $postid, |
| 157 | 157 | 'permalink' => get_permalink(), |
| 158 | 158 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
| 159 | 159 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
| 160 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
| 160 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
| 161 | 161 | 'can_publish_posts' => current_user_can('publish_posts'), |
| 162 | 162 | 'can_publish_pages' => current_user_can('publish_pages'), |
| 163 | 163 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -192,24 +192,24 @@ discard block |
||
| 192 | 192 | 'postTags' => lasso_get_objects('tag'), |
| 193 | 193 | 'noResultsDiv' => lasso_editor_empty_results(), |
| 194 | 194 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
| 195 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
| 196 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
| 197 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
| 198 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
| 195 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
| 196 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
| 197 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
| 198 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
| 199 | 199 | 'revisionModal' => lasso_editor_revision_modal(), |
| 200 | 200 | 'isMobile' => wp_is_mobile(), |
| 201 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
| 201 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
| 202 | 202 | 'showColor' => $show_color, |
| 203 | 203 | 'showAlignment' => $show_align, |
| 204 | 204 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
| 205 | 205 | 'restapi2' => $using_restapiv2, |
| 206 | 206 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
| 207 | - 'newObjectContent' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ), |
|
| 207 | + 'newObjectContent' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')), |
|
| 208 | 208 | 'disableSavePost' => $save_to_post_disabled, |
| 209 | 209 | 'boldTag' => $bold_tag, |
| 210 | 210 | 'iTag' => $i_tag, |
| 211 | 211 | 'customFields' => $custom_fields, |
| 212 | - 'skipToEdit' =>( $delta < 30 ) // if it's a new post, skip to edit mode |
|
| 212 | + 'skipToEdit' =>($delta < 30) // if it's a new post, skip to edit mode |
|
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | 215 | |
@@ -218,18 +218,18 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | if (!$using_restapiv2) { |
| 220 | 220 | // enqueue REST API V1 |
| 221 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
| 222 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
| 223 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
| 221 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
| 222 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
| 223 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
| 226 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
| 227 | 227 | if ($show_color) { |
| 228 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
| 228 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
| 229 | 229 | } else { |
| 230 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
| 230 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
| 231 | 231 | } |
| 232 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
| 232 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | } |
@@ -16,80 +16,80 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $array = array( |
| 18 | 18 | 'quote' => array( |
| 19 | - 'name' => __('Quote','lasso'), |
|
| 19 | + 'name' => __('Quote', 'lasso'), |
|
| 20 | 20 | 'content' => lasso_quote_component(), |
| 21 | 21 | ), |
| 22 | 22 | 'image' => array( |
| 23 | - 'name' => __('Image','lasso'), |
|
| 23 | + 'name' => __('Image', 'lasso'), |
|
| 24 | 24 | 'content' => lasso_image_component(), |
| 25 | 25 | ), |
| 26 | 26 | 'parallax' => array( |
| 27 | - 'name' => __('Parallax','lasso'), |
|
| 27 | + 'name' => __('Parallax', 'lasso'), |
|
| 28 | 28 | 'content' => lasso_parallax_component(), |
| 29 | 29 | ), |
| 30 | 30 | 'audio' => array( |
| 31 | - 'name' => __('Audio','lasso'), |
|
| 31 | + 'name' => __('Audio', 'lasso'), |
|
| 32 | 32 | 'content' => lasso_audio_component(), |
| 33 | 33 | ), |
| 34 | 34 | 'content' => array( |
| 35 | - 'name' => __('Content','lasso'), |
|
| 35 | + 'name' => __('Content', 'lasso'), |
|
| 36 | 36 | 'content' => lasso_content_component(), |
| 37 | 37 | ), |
| 38 | 38 | 'character' => array( |
| 39 | - 'name' => __('Character','lasso'), |
|
| 39 | + 'name' => __('Character', 'lasso'), |
|
| 40 | 40 | 'content' => lasso_character_component(), |
| 41 | 41 | ), |
| 42 | 42 | 'collection' => array( |
| 43 | - 'name' => __('Collection','lasso'), |
|
| 43 | + 'name' => __('Collection', 'lasso'), |
|
| 44 | 44 | 'content' => lasso_collections_component(), |
| 45 | 45 | ), |
| 46 | 46 | 'document' => array( |
| 47 | - 'name' => __('Document','lasso'), |
|
| 47 | + 'name' => __('Document', 'lasso'), |
|
| 48 | 48 | 'content' => lasso_document_component(), |
| 49 | 49 | ), |
| 50 | 50 | 'gallery' => array( |
| 51 | - 'name' => __('Gallery','lasso'), |
|
| 51 | + 'name' => __('Gallery', 'lasso'), |
|
| 52 | 52 | 'content' => lasso_gallery_component(), |
| 53 | 53 | ), |
| 54 | 54 | 'chapter' => array( |
| 55 | - 'name' => __('Chapter','lasso'), |
|
| 55 | + 'name' => __('Chapter', 'lasso'), |
|
| 56 | 56 | 'content' => lasso_heading_component(), |
| 57 | 57 | ), |
| 58 | 58 | 'map' => array( |
| 59 | - 'name' => __('Map','lasso'), |
|
| 59 | + 'name' => __('Map', 'lasso'), |
|
| 60 | 60 | 'content' => lasso_map_component(), |
| 61 | 61 | ), |
| 62 | 62 | 'timeline_stop' => array( |
| 63 | - 'name' => __('Timeline','lasso'), |
|
| 63 | + 'name' => __('Timeline', 'lasso'), |
|
| 64 | 64 | 'content' => lasso_timeline_component(), |
| 65 | 65 | ), |
| 66 | 66 | 'video' => array( |
| 67 | - 'name' => __('Video','lasso'), |
|
| 67 | + 'name' => __('Video', 'lasso'), |
|
| 68 | 68 | 'content' => lasso_video_component(), |
| 69 | 69 | ), |
| 70 | 70 | 'wpimg' => array( |
| 71 | - 'name' => __('WordPress Image','lasso'), |
|
| 71 | + 'name' => __('WordPress Image', 'lasso'), |
|
| 72 | 72 | 'content' => lasso_wp_image(), |
| 73 | 73 | ), |
| 74 | 74 | 'wpquote' => array( |
| 75 | - 'name' => __('WordPress Quote','lasso'), |
|
| 75 | + 'name' => __('WordPress Quote', 'lasso'), |
|
| 76 | 76 | 'content' => lasso_wp_quote(), |
| 77 | 77 | ), |
| 78 | 78 | 'gallery_pop' => array( |
| 79 | - 'name' => __('Gallery Pop','lasso'), |
|
| 79 | + 'name' => __('Gallery Pop', 'lasso'), |
|
| 80 | 80 | 'content' => lasso_gallery_pop_component(), |
| 81 | 81 | ), |
| 82 | 82 | 'events' => array( |
| 83 | - 'name' => __('Events','lasso'), |
|
| 83 | + 'name' => __('Events', 'lasso'), |
|
| 84 | 84 | 'content' => lasso_event_component(), |
| 85 | 85 | ), |
| 86 | 86 | 'wpvideo' => array( |
| 87 | - 'name' => __('WordPress Image','lasso'), |
|
| 87 | + 'name' => __('WordPress Image', 'lasso'), |
|
| 88 | 88 | 'content' => lasso_wp_video(), |
| 89 | 89 | ), |
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | - return apply_filters( 'lasso_components', $array ); |
|
| 92 | + return apply_filters('lasso_components', $array); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -115,132 +115,132 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | // 1 |
| 118 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
| 118 | +if (!function_exists('lasso_quote_component')): |
|
| 119 | 119 | function lasso_quote_component() { |
| 120 | 120 | |
| 121 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
| 121 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
| 122 | 122 | } |
| 123 | 123 | endif; |
| 124 | 124 | |
| 125 | 125 | // 2 |
| 126 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
| 126 | +if (!function_exists('lasso_image_component')): |
|
| 127 | 127 | function lasso_image_component() { |
| 128 | 128 | |
| 129 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' ); |
|
| 129 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]'); |
|
| 130 | 130 | } |
| 131 | 131 | endif; |
| 132 | 132 | |
| 133 | 133 | // 3 |
| 134 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
| 134 | +if (!function_exists('lasso_parallax_component')): |
|
| 135 | 135 | function lasso_parallax_component() { |
| 136 | 136 | |
| 137 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
| 137 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
| 138 | 138 | } |
| 139 | 139 | endif; |
| 140 | 140 | |
| 141 | 141 | // 4 |
| 142 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
| 142 | +if (!function_exists('lasso_audio_component')): |
|
| 143 | 143 | function lasso_audio_component() { |
| 144 | 144 | |
| 145 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
| 145 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
| 146 | 146 | |
| 147 | 147 | } |
| 148 | 148 | endif; |
| 149 | 149 | |
| 150 | 150 | // 5 |
| 151 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
| 151 | +if (!function_exists('lasso_content_component')): |
|
| 152 | 152 | function lasso_content_component() { |
| 153 | 153 | |
| 154 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
| 154 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
| 155 | 155 | } |
| 156 | 156 | endif; |
| 157 | 157 | |
| 158 | 158 | // 6 |
| 159 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
| 159 | +if (!function_exists('lasso_character_component')): |
|
| 160 | 160 | function lasso_character_component() { |
| 161 | 161 | |
| 162 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
| 162 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
| 163 | 163 | |
| 164 | 164 | } |
| 165 | 165 | endif; |
| 166 | 166 | |
| 167 | 167 | // 7 |
| 168 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
| 168 | +if (!function_exists('lasso_collections_component')): |
|
| 169 | 169 | function lasso_collections_component() { |
| 170 | 170 | |
| 171 | - return do_shortcode( '[aesop_collection]' ); |
|
| 171 | + return do_shortcode('[aesop_collection]'); |
|
| 172 | 172 | } |
| 173 | 173 | endif; |
| 174 | 174 | |
| 175 | 175 | // 8 |
| 176 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
| 176 | +if (!function_exists('lasso_document_component')): |
|
| 177 | 177 | function lasso_document_component() { |
| 178 | 178 | |
| 179 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
| 179 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
| 180 | 180 | |
| 181 | 181 | } |
| 182 | 182 | endif; |
| 183 | 183 | |
| 184 | 184 | // 9 |
| 185 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
| 185 | +if (!function_exists('lasso_gallery_component')): |
|
| 186 | 186 | function lasso_gallery_component() { |
| 187 | 187 | |
| 188 | - return do_shortcode( '[aesop_gallery]' ); |
|
| 188 | + return do_shortcode('[aesop_gallery]'); |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | endif; |
| 192 | 192 | |
| 193 | 193 | // 10 |
| 194 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
| 194 | +if (!function_exists('lasso_heading_component')): |
|
| 195 | 195 | function lasso_heading_component() { |
| 196 | 196 | |
| 197 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
| 197 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
| 198 | 198 | } |
| 199 | 199 | endif; |
| 200 | 200 | |
| 201 | 201 | // 11 |
| 202 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
| 202 | +if (!function_exists('lasso_map_component')): |
|
| 203 | 203 | function lasso_map_component() { |
| 204 | 204 | |
| 205 | 205 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
| 206 | 206 | '.lasso_map_form_footer().' |
| 207 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
| 207 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
| 208 | 208 | </form>'; |
| 209 | 209 | |
| 210 | 210 | } |
| 211 | 211 | endif; |
| 212 | 212 | |
| 213 | 213 | // 12 |
| 214 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
| 214 | +if (!function_exists('lasso_timeline_component')): |
|
| 215 | 215 | function lasso_timeline_component() { |
| 216 | 216 | |
| 217 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
| 217 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
| 218 | 218 | |
| 219 | 219 | } |
| 220 | 220 | endif; |
| 221 | 221 | |
| 222 | 222 | // 13 |
| 223 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
| 223 | +if (!function_exists('lasso_video_component')): |
|
| 224 | 224 | function lasso_video_component() { |
| 225 | 225 | |
| 226 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
| 226 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
| 227 | 227 | |
| 228 | 228 | } |
| 229 | 229 | endif; |
| 230 | 230 | |
| 231 | 231 | // 14 - since 0.9.1 |
| 232 | -if ( !function_exists('lasso_wp_image') ): |
|
| 232 | +if (!function_exists('lasso_wp_image')): |
|
| 233 | 233 | |
| 234 | - function lasso_wp_image(){ |
|
| 234 | + function lasso_wp_image() { |
|
| 235 | 235 | return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>'; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | endif; |
| 239 | 239 | |
| 240 | 240 | // 15 - since 0.9.2 |
| 241 | -if ( !function_exists('lasso_wp_quote') ): |
|
| 241 | +if (!function_exists('lasso_wp_quote')): |
|
| 242 | 242 | |
| 243 | - function lasso_wp_quote(){ |
|
| 243 | + function lasso_wp_quote() { |
|
| 244 | 244 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>'; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -248,30 +248,30 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
| 250 | 250 | |
| 251 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
| 251 | +if (!function_exists('lasso_gallery_pop_component')): |
|
| 252 | 252 | function lasso_gallery_pop_component() { |
| 253 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
| 253 | + return do_shortcode('[aesop_gallery_pop]'); |
|
| 254 | 254 | } |
| 255 | 255 | endif; |
| 256 | 256 | |
| 257 | 257 | // 17 - work in progress |
| 258 | 258 | |
| 259 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
| 259 | +if (!function_exists('lasso_event_component')): |
|
| 260 | 260 | function lasso_event_component() { |
| 261 | 261 | $id = editus_get_one_id('aesop_events'); |
| 262 | 262 | file_put_contents(WP_PLUGIN_DIR."/file1.txt", $id); |
| 263 | - if ($id ==-1) { |
|
| 264 | - return do_shortcode( '[aesop_events]' ); |
|
| 263 | + if ($id == -1) { |
|
| 264 | + return do_shortcode('[aesop_events]'); |
|
| 265 | 265 | } else { |
| 266 | - return do_shortcode( '[aesop_events id = "'.$id.'"]' ); |
|
| 266 | + return do_shortcode('[aesop_events id = "'.$id.'"]'); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | endif; |
| 270 | 270 | |
| 271 | 271 | // 18 - work in progress |
| 272 | -if ( !function_exists('lasso_wp_video') ): |
|
| 272 | +if (!function_exists('lasso_wp_video')): |
|
| 273 | 273 | |
| 274 | - function lasso_wp_video(){ |
|
| 274 | + function lasso_wp_video() { |
|
| 275 | 275 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
| 276 | 276 | } |
| 277 | 277 | |
@@ -280,10 +280,10 @@ discard block |
||
| 280 | 280 | // helper function to retrieve one id for default option |
| 281 | 281 | function editus_get_one_id($type) |
| 282 | 282 | { |
| 283 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
| 284 | - $posts = get_posts( $args ); |
|
| 285 | - if ( $posts ) { |
|
| 286 | - foreach ( $posts as $post ) { |
|
| 283 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
| 284 | + $posts = get_posts($args); |
|
| 285 | + if ($posts) { |
|
| 286 | + foreach ($posts as $post) { |
|
| 287 | 287 | return $post->ID; |
| 288 | 288 | } |
| 289 | 289 | } |