Version Description
Download this release
Release Info
Developer | TemplateMonster 2002 |
Plugin | Cherry Testimonials |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.1.0
- admin/assets/css/admin.css +1 -1
- admin/assets/js/admin.js +81 -81
- admin/assets/scss/admin.scss +36 -36
- admin/includes/class-tm-testimonials-admin.php +261 -261
- admin/includes/class-tm-testimonials-ajax.php +109 -109
- admin/includes/index.php +9 -9
- admin/index.php +9 -9
- admin/views/shortcode-settings.php +27 -27
- cherry-framework/cherry-core.php +469 -496
- cherry-framework/config.json +196 -174
- cherry-framework/languages/cherry-framework.pot +119 -69
- cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php +1597 -0
- cherry-framework/modules/cherry-customizer/assets/fonts/google.json +15622 -0
- cherry-framework/modules/cherry-customizer/assets/fonts/standard.json +209 -0
- cherry-framework/modules/cherry-customizer/cherry-customizer.php +1173 -0
- cherry-framework/modules/cherry-customizer/inc/class-cherry-wp-customize-iconpicker.php +105 -0
- cherry-framework/modules/cherry-db-updater/cherry-db-updater.php +379 -0
- cherry-framework/modules/cherry-dynamic-css/assets/cherry-css-collector.js +24 -0
- cherry-framework/modules/cherry-dynamic-css/assets/min/cherry-css-collector.min.js +1 -0
- cherry-framework/modules/cherry-dynamic-css/cherry-dynamic-css.php +543 -0
- cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-collector.php +281 -0
- cherry-framework/modules/cherry-dynamic-css/inc/class-cherry-dynamic-css-utilities.php +858 -0
- cherry-framework/modules/cherry-google-fonts-loader/cherry-google-fonts-loader.php +365 -0
- cherry-framework/modules/cherry-handler/assets/css/cherry-handler-styles.min.css +1 -1
- cherry-framework/modules/cherry-handler/assets/js/cherry-handler.js +309 -287
- cherry-framework/modules/cherry-handler/assets/js/min/cherry-handler.min.js +1 -1
- cherry-framework/modules/cherry-handler/assets/scss/cherry-handler-styles.scss +65 -65
- cherry-framework/modules/cherry-handler/cherry-handler.php +246 -233
- cherry-framework/modules/cherry-interface-builder/cherry-interface-builder.php +495 -471
- cherry-framework/modules/cherry-interface-builder/inc/assets/_use-in-js.scss +17 -17
- cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.js +193 -189
- cherry-framework/modules/cherry-interface-builder/inc/assets/cherry-interface-builder.scss +503 -463
- cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.css +1 -1
- cherry-framework/modules/cherry-interface-builder/inc/assets/min/cherry-interface-builder.min.js +1 -1
- cherry-framework/modules/cherry-interface-builder/inc/views/component-accordion.php +30 -30
- cherry-framework/modules/cherry-interface-builder/inc/views/component-repeater.php +30 -30
- cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-horizontal.php +35 -35
- cherry-framework/modules/cherry-interface-builder/inc/views/component-tab-vertical.php +35 -35
- cherry-framework/modules/cherry-interface-builder/inc/views/component-toggle.php +30 -30
- cherry-framework/modules/cherry-interface-builder/inc/views/control.php +34 -34
- cherry-framework/modules/cherry-interface-builder/inc/views/form.php +24 -24
- cherry-framework/modules/cherry-interface-builder/inc/views/html.php +24 -24
- cherry-framework/modules/cherry-interface-builder/inc/views/section.php +36 -36
- cherry-framework/modules/cherry-interface-builder/inc/views/settings-children-title.php +18 -18
- cherry-framework/modules/cherry-interface-builder/inc/views/settings.php +32 -32
- cherry-framework/modules/cherry-interface-builder/inc/views/tab-children-title.php +20 -20
- cherry-framework/modules/cherry-interface-builder/inc/views/toggle-children-title.php +22 -22
- cherry-framework/modules/cherry-js-core/assets/js/cherry-js-core.js +100 -100
- cherry-framework/modules/cherry-js-core/assets/js/min/cherry-js-core.min.js +1 -1
- cherry-framework/modules/cherry-js-core/cherry-js-core.php +200 -184
- cherry-framework/modules/cherry-post-formats-api/assets/js/cherry-post-formats.js +68 -0
- cherry-framework/modules/cherry-post-formats-api/assets/js/min/cherry-post-formats.min.js +1 -0
- cherry-framework/modules/cherry-post-formats-api/cherry-post-formats-api.php +1121 -0
- cherry-framework/modules/cherry-post-formats-api/inc/class-cherry-facebook-embed.php +81 -0
- cherry-framework/modules/cherry-post-meta/cherry-post-meta.php +545 -547
- cherry-framework/modules/cherry-template-manager/cherry-template-manager.php +112 -0
- cherry-framework/modules/cherry-template-manager/inc/cherry-template-loader.php +193 -0
- cherry-framework/modules/cherry-template-manager/inc/cherry-template-parser.php +196 -0
- cherry-framework/modules/cherry-term-meta/cherry-term-meta.php +301 -0
- cherry-framework/modules/cherry-toolkit/cherry-toolkit.php +217 -219
- cherry-framework/modules/cherry-ui-elements/assets/sass/_lock.scss +110 -0
- cherry-framework/modules/cherry-ui-elements/cherry-ui-elements.php +170 -154
- cherry-framework/modules/cherry-ui-elements/i-ui.php +45 -45
- cherry-framework/modules/cherry-ui-elements/inc/class-cherry-lock-element.php +128 -0
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/min/ui-button.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-button.scss +66 -52
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_mixins.scss +42 -182
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/assets/ui-kit/_variables.scss +46 -25
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/ui-button.php +86 -87
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-button/view/button-view.php +37 -31
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/min/ui-checkbox.min.js +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.js +58 -58
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-checkbox.scss +65 -58
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-kit/_mixins.scss +184 -182
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/assets/ui-kit/_variables.scss +22 -22
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-checkbox/ui-checkbox.php +154 -131
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/min/ui-colorpicker.min.css +1 -1
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.js +26 -26
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-colorpicker.scss +98 -53
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-kit/_mixins.scss +184 -182
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/assets/ui-kit/_variables.scss +22 -22
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-colorpicker/ui-colorpicker.php +114 -98
- cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-iconpicker/assets/jquery-iconpicker.js +0 -445
admin/assets/css/admin.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cherry-testi-option-form__buttons{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;padding:15px 30px}.cherry-testi-option-form__buttons button{position:relative;margin-left:15px}.cherry-testi-option-form__buttons svg{position:absolute;right:10px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:inline;width:16px;height:16px;opacity:0;visibility:hidden;-webkit-transition:opacity .2s linear .1s, visibility .1s linear .2s;transition:opacity .2s linear .1s, visibility .1s linear .2s}.cherry-testi-option-form__buttons button[disabled] svg{opacity:1;visibility:visible}.cherry-testi-option-form__buttons circle{stroke:#fff}.cherry-testi-shortcode-title{color:initial}
|
1 |
+
.cherry-testi-option-form__buttons{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;padding:15px 30px}.cherry-testi-option-form__buttons button{position:relative;margin-left:15px}.cherry-testi-option-form__buttons svg{position:absolute;right:10px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:inline;width:16px;height:16px;opacity:0;visibility:hidden;-webkit-transition:opacity .2s linear .1s, visibility .1s linear .2s;transition:opacity .2s linear .1s, visibility .1s linear .2s}.cherry-testi-option-form__buttons button[disabled] svg{opacity:1;visibility:visible}.cherry-testi-option-form__buttons circle{stroke:#fff}.cherry-testi-shortcode-title{color:initial}
|
admin/assets/js/admin.js
CHANGED
@@ -1,81 +1,81 @@
|
|
1 |
-
( function( $, CherryJsCore ) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
CherryJsCore.utilites.namespace( 'cherryTestiAdminScripts' );
|
5 |
-
|
6 |
-
CherryJsCore.cherryTestiAdminScripts = {
|
7 |
-
saveHandlerId: 'cherry_testi_save_setting',
|
8 |
-
resetHandlerId: 'cherry_testi_reset_setting',
|
9 |
-
saveButtonId: '#cherry-testi-option-form__save',
|
10 |
-
resetButtonId: '#cherry-testi-option-form__reset',
|
11 |
-
formId: '#cherry-testi-option-form',
|
12 |
-
saveOptionsInstance: null,
|
13 |
-
resetOptionsInstance: null,
|
14 |
-
|
15 |
-
init: function() {
|
16 |
-
this.saveOptionsInstance = new CherryJsCore.CherryAjaxHandler(
|
17 |
-
{
|
18 |
-
handlerId: this.saveHandlerId,
|
19 |
-
successCallback: this.saveSuccessCallback.bind( this )
|
20 |
-
}
|
21 |
-
);
|
22 |
-
|
23 |
-
this.resetOptionsInstance = new CherryJsCore.CherryAjaxHandler(
|
24 |
-
{
|
25 |
-
handlerId: this.resetHandlerId,
|
26 |
-
successCallback: this.resetSuccessCallback.bind( this )
|
27 |
-
}
|
28 |
-
);
|
29 |
-
|
30 |
-
this.addEvents();
|
31 |
-
},
|
32 |
-
|
33 |
-
addEvents: function() {
|
34 |
-
$( 'body' )
|
35 |
-
.on( 'click', this.saveButtonId, this.saveOptionsHandler.bind( this ) )
|
36 |
-
.on( 'click', this.resetButtonId, this.resetOptionsHandler.bind( this ) );
|
37 |
-
},
|
38 |
-
|
39 |
-
saveOptionsHandler: function( event ) {
|
40 |
-
this.disableButton( event.target );
|
41 |
-
this.saveOptionsInstance.sendFormData( this.formId );
|
42 |
-
},
|
43 |
-
|
44 |
-
resetOptionsHandler: function( event ) {
|
45 |
-
this.disableButton( event.target );
|
46 |
-
this.resetOptionsInstance.send();
|
47 |
-
},
|
48 |
-
|
49 |
-
resetSuccessCallback: function() {
|
50 |
-
this.enableButton( this.resetButtonId );
|
51 |
-
},
|
52 |
-
|
53 |
-
saveSuccessCallback: function() {
|
54 |
-
this.enableButton( this.saveButtonId );
|
55 |
-
},
|
56 |
-
|
57 |
-
disableButton: function( button ) {
|
58 |
-
$( button )
|
59 |
-
.attr( 'disabled', 'disabled' );
|
60 |
-
},
|
61 |
-
|
62 |
-
enableButton: function( button ) {
|
63 |
-
var timer = null;
|
64 |
-
|
65 |
-
$( button )
|
66 |
-
.removeAttr( 'disabled' )
|
67 |
-
.addClass( 'success' );
|
68 |
-
|
69 |
-
timer = setTimeout(
|
70 |
-
function() {
|
71 |
-
$( button ).removeClass( 'success' );
|
72 |
-
clearTimeout( timer );
|
73 |
-
},
|
74 |
-
1000
|
75 |
-
);
|
76 |
-
}
|
77 |
-
};
|
78 |
-
|
79 |
-
CherryJsCore.cherryTestiAdminScripts.init();
|
80 |
-
|
81 |
-
}( jQuery, window.CherryJsCore ) );
|
1 |
+
( function( $, CherryJsCore ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
CherryJsCore.utilites.namespace( 'cherryTestiAdminScripts' );
|
5 |
+
|
6 |
+
CherryJsCore.cherryTestiAdminScripts = {
|
7 |
+
saveHandlerId: 'cherry_testi_save_setting',
|
8 |
+
resetHandlerId: 'cherry_testi_reset_setting',
|
9 |
+
saveButtonId: '#cherry-testi-option-form__save',
|
10 |
+
resetButtonId: '#cherry-testi-option-form__reset',
|
11 |
+
formId: '#cherry-testi-option-form',
|
12 |
+
saveOptionsInstance: null,
|
13 |
+
resetOptionsInstance: null,
|
14 |
+
|
15 |
+
init: function() {
|
16 |
+
this.saveOptionsInstance = new CherryJsCore.CherryAjaxHandler(
|
17 |
+
{
|
18 |
+
handlerId: this.saveHandlerId,
|
19 |
+
successCallback: this.saveSuccessCallback.bind( this )
|
20 |
+
}
|
21 |
+
);
|
22 |
+
|
23 |
+
this.resetOptionsInstance = new CherryJsCore.CherryAjaxHandler(
|
24 |
+
{
|
25 |
+
handlerId: this.resetHandlerId,
|
26 |
+
successCallback: this.resetSuccessCallback.bind( this )
|
27 |
+
}
|
28 |
+
);
|
29 |
+
|
30 |
+
this.addEvents();
|
31 |
+
},
|
32 |
+
|
33 |
+
addEvents: function() {
|
34 |
+
$( 'body' )
|
35 |
+
.on( 'click', this.saveButtonId, this.saveOptionsHandler.bind( this ) )
|
36 |
+
.on( 'click', this.resetButtonId, this.resetOptionsHandler.bind( this ) );
|
37 |
+
},
|
38 |
+
|
39 |
+
saveOptionsHandler: function( event ) {
|
40 |
+
this.disableButton( event.target );
|
41 |
+
this.saveOptionsInstance.sendFormData( this.formId );
|
42 |
+
},
|
43 |
+
|
44 |
+
resetOptionsHandler: function( event ) {
|
45 |
+
this.disableButton( event.target );
|
46 |
+
this.resetOptionsInstance.send();
|
47 |
+
},
|
48 |
+
|
49 |
+
resetSuccessCallback: function() {
|
50 |
+
this.enableButton( this.resetButtonId );
|
51 |
+
},
|
52 |
+
|
53 |
+
saveSuccessCallback: function() {
|
54 |
+
this.enableButton( this.saveButtonId );
|
55 |
+
},
|
56 |
+
|
57 |
+
disableButton: function( button ) {
|
58 |
+
$( button )
|
59 |
+
.attr( 'disabled', 'disabled' );
|
60 |
+
},
|
61 |
+
|
62 |
+
enableButton: function( button ) {
|
63 |
+
var timer = null;
|
64 |
+
|
65 |
+
$( button )
|
66 |
+
.removeAttr( 'disabled' )
|
67 |
+
.addClass( 'success' );
|
68 |
+
|
69 |
+
timer = setTimeout(
|
70 |
+
function() {
|
71 |
+
$( button ).removeClass( 'success' );
|
72 |
+
clearTimeout( timer );
|
73 |
+
},
|
74 |
+
1000
|
75 |
+
);
|
76 |
+
}
|
77 |
+
};
|
78 |
+
|
79 |
+
CherryJsCore.cherryTestiAdminScripts.init();
|
80 |
+
|
81 |
+
}( jQuery, window.CherryJsCore ) );
|
admin/assets/scss/admin.scss
CHANGED
@@ -1,37 +1,37 @@
|
|
1 |
-
.cherry-testi-option-form__buttons {
|
2 |
-
display: flex;
|
3 |
-
justify-content: flex-end;
|
4 |
-
padding: 15px 30px;
|
5 |
-
}
|
6 |
-
|
7 |
-
.cherry-testi-option-form__buttons button {
|
8 |
-
position: relative;
|
9 |
-
margin-left: 15px;
|
10 |
-
}
|
11 |
-
|
12 |
-
.cherry-testi-option-form__buttons svg {
|
13 |
-
position: absolute;
|
14 |
-
right: 10px;
|
15 |
-
top: 50%;
|
16 |
-
transform: translateY(-50%);
|
17 |
-
display: inline;
|
18 |
-
width: 16px;
|
19 |
-
height: 16px;
|
20 |
-
opacity: 0;
|
21 |
-
visibility: hidden;
|
22 |
-
transition: opacity .2s linear .1s,
|
23 |
-
visibility .1s linear .2s;
|
24 |
-
}
|
25 |
-
|
26 |
-
.cherry-testi-option-form__buttons button[disabled] svg {
|
27 |
-
opacity: 1;
|
28 |
-
visibility: visible;
|
29 |
-
}
|
30 |
-
|
31 |
-
.cherry-testi-option-form__buttons circle {
|
32 |
-
stroke: #fff;
|
33 |
-
}
|
34 |
-
|
35 |
-
.cherry-testi-shortcode-title {
|
36 |
-
color: initial;
|
37 |
}
|
1 |
+
.cherry-testi-option-form__buttons {
|
2 |
+
display: flex;
|
3 |
+
justify-content: flex-end;
|
4 |
+
padding: 15px 30px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.cherry-testi-option-form__buttons button {
|
8 |
+
position: relative;
|
9 |
+
margin-left: 15px;
|
10 |
+
}
|
11 |
+
|
12 |
+
.cherry-testi-option-form__buttons svg {
|
13 |
+
position: absolute;
|
14 |
+
right: 10px;
|
15 |
+
top: 50%;
|
16 |
+
transform: translateY(-50%);
|
17 |
+
display: inline;
|
18 |
+
width: 16px;
|
19 |
+
height: 16px;
|
20 |
+
opacity: 0;
|
21 |
+
visibility: hidden;
|
22 |
+
transition: opacity .2s linear .1s,
|
23 |
+
visibility .1s linear .2s;
|
24 |
+
}
|
25 |
+
|
26 |
+
.cherry-testi-option-form__buttons button[disabled] svg {
|
27 |
+
opacity: 1;
|
28 |
+
visibility: visible;
|
29 |
+
}
|
30 |
+
|
31 |
+
.cherry-testi-option-form__buttons circle {
|
32 |
+
stroke: #fff;
|
33 |
+
}
|
34 |
+
|
35 |
+
.cherry-testi-shortcode-title {
|
36 |
+
color: initial;
|
37 |
}
|
admin/includes/class-tm-testimonials-admin.php
CHANGED
@@ -1,261 +1,261 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sets up the admin functionality for the plugin.
|
4 |
-
*
|
5 |
-
* @package Cherry_Testi
|
6 |
-
* @subpackage Admin
|
7 |
-
* @author Template Monster
|
8 |
-
* @license GPL-3.0+
|
9 |
-
* @copyright 2002-2016, Template Monster
|
10 |
-
*/
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Class for Testimonials admin functionality.
|
14 |
-
*
|
15 |
-
* @since 1.0.0
|
16 |
-
*/
|
17 |
-
class TM_Testimonials_Admin {
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Holds the instances of this class.
|
21 |
-
*
|
22 |
-
* @since 1.0.0
|
23 |
-
* @var object
|
24 |
-
*/
|
25 |
-
private static $instance = null;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Sets up needed actions/filters for the admin to initialize.
|
29 |
-
*
|
30 |
-
* @since 1.0.0
|
31 |
-
* @return void
|
32 |
-
*/
|
33 |
-
public function __construct() {
|
34 |
-
$this->plugin = tm_testimonials_plugin();
|
35 |
-
$this->post_type = $this->plugin->get_post_type_name();
|
36 |
-
|
37 |
-
// Load post meta boxes on the post editing screen.
|
38 |
-
add_action( 'load-post.php', array( $this, 'metabox' ) );
|
39 |
-
add_action( 'load-post-new.php', array( $this, 'metabox' ) );
|
40 |
-
|
41 |
-
// Only run our customization on the 'edit.php' page in the admin.
|
42 |
-
add_action( 'load-edit.php', array( $this, 'manage_columns' ) );
|
43 |
-
|
44 |
-
// Modify the quick links in admin table list.
|
45 |
-
add_filter( 'post_row_actions', array( $this, 'modify_row_actions' ), 10, 2 );
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Init `cherry-post-meta` module on the `Add New Testimonial` and `Edit Testimonial` screens.
|
50 |
-
*
|
51 |
-
* @since 1.0.0
|
52 |
-
*/
|
53 |
-
public function metabox() {
|
54 |
-
$screen = get_current_screen();
|
55 |
-
|
56 |
-
if ( empty( $screen->post_type ) || $this->post_type !== $screen->post_type ) {
|
57 |
-
return;
|
58 |
-
}
|
59 |
-
|
60 |
-
// Print custom styles.
|
61 |
-
add_action( 'admin_head', array( $this, 'print_styles' ) );
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Filter the array of metabox's fields.
|
65 |
-
*
|
66 |
-
* @since 1.0.0
|
67 |
-
*/
|
68 |
-
$metabox_args = apply_filters( 'tm_testimonials_metabox_args', array(
|
69 |
-
'id' => 'tm-testi-options',
|
70 |
-
'title' => esc_html__( 'Testimonial Options', 'cherry-testi' ),
|
71 |
-
'page' => $this->post_type,
|
72 |
-
'context' => 'side',
|
73 |
-
'priority' => 'core',
|
74 |
-
'callback_args' => false,
|
75 |
-
'single' => array( 'key' => TM_TESTI_POSTMETA ),
|
76 |
-
'fields' => array(
|
77 |
-
'email' => array(
|
78 |
-
'id' => TM_TESTI_POSTMETA . 'email',
|
79 |
-
'name' => TM_TESTI_POSTMETA . '[email]',
|
80 |
-
'type' => 'text',
|
81 |
-
'label' => esc_html__( 'Email:', 'cherry-testi' ),
|
82 |
-
'placeholder' => esc_html__( 'email@demolink.org', 'cherry-testi' ),
|
83 |
-
'value' => '',
|
84 |
-
'master' => 'tm-testi-ui-container',
|
85 |
-
),
|
86 |
-
'url' => array(
|
87 |
-
'id' => TM_TESTI_POSTMETA . 'url',
|
88 |
-
'name' => TM_TESTI_POSTMETA . '[url]',
|
89 |
-
'type' => 'text',
|
90 |
-
'label' => esc_html__( 'URL:', 'cherry-testi' ),
|
91 |
-
'placeholder' => esc_html__( 'http://demolink.org', 'cherry-testi' ),
|
92 |
-
'value' => '',
|
93 |
-
'master' => 'tm-testi-ui-container',
|
94 |
-
),
|
95 |
-
'position' => array(
|
96 |
-
'id' => TM_TESTI_POSTMETA . 'position',
|
97 |
-
'name' => TM_TESTI_POSTMETA . '[position]',
|
98 |
-
'type' => 'text',
|
99 |
-
'label' => esc_html__( 'Position:', 'cherry-testi' ),
|
100 |
-
'placeholder' => esc_html__( 'CEO/Founder', 'cherry-testi' ),
|
101 |
-
'value' => '',
|
102 |
-
'master' => 'tm-testi-ui-container',
|
103 |
-
),
|
104 |
-
'company' => array(
|
105 |
-
'id' => TM_TESTI_POSTMETA . 'company',
|
106 |
-
'name' => TM_TESTI_POSTMETA . '[company]',
|
107 |
-
'type' => 'text',
|
108 |
-
'label' => esc_html__( 'Company Name:', 'cherry-testi' ),
|
109 |
-
'placeholder' => esc_html__( 'Demo & Co', 'cherry-testi' ),
|
110 |
-
'value' => '',
|
111 |
-
'master' => 'tm-testi-ui-container',
|
112 |
-
),
|
113 |
-
),
|
114 |
-
) );
|
115 |
-
|
116 |
-
$this->plugin->get_core()->init_module( 'cherry-post-meta', $metabox_args );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Adds a custom filter on 'request' when viewing the `Testimonials` screen in the admin.
|
121 |
-
*
|
122 |
-
* @since 1.0.0
|
123 |
-
*/
|
124 |
-
public function manage_columns() {
|
125 |
-
$screen = get_current_screen();
|
126 |
-
|
127 |
-
if ( empty( $screen->post_type ) || $this->post_type !== $screen->post_type ) {
|
128 |
-
return;
|
129 |
-
}
|
130 |
-
|
131 |
-
// Modify the columns on the `Testimonials` screen.
|
132 |
-
add_filter( "manage_edit-{$this->post_type}_columns", array( $this, 'columns' ) );
|
133 |
-
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'custom_column' ), 10, 2 );
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Filters the columns on the `Testimonials` screen.
|
138 |
-
*
|
139 |
-
* @since 1.0.0
|
140 |
-
* @param array $post_columns An array of column name => label.
|
141 |
-
* @return array
|
142 |
-
*/
|
143 |
-
public function columns( $post_columns ) {
|
144 |
-
|
145 |
-
unset(
|
146 |
-
$post_columns['author'],
|
147 |
-
$post_columns[ 'taxonomy-' . $this->post_type . '_category' ],
|
148 |
-
$post_columns['date']
|
149 |
-
);
|
150 |
-
|
151 |
-
// Add custom columns and overwrite the 'date' column.
|
152 |
-
$post_columns['thumbnail'] = esc_html__( 'Avatar', 'cherry-testi' );
|
153 |
-
$post_columns['author_name'] = esc_html__( 'Author Name', 'cherry-testi' );
|
154 |
-
$post_columns['position'] = esc_html__( 'Position', 'cherry-testi' );
|
155 |
-
$post_columns['company_name'] = esc_html__( 'Company Name', 'cherry-testi' );
|
156 |
-
$post_columns[ 'taxonomy-' . $this->post_type . '_category' ] = esc_html__( 'Category', 'cherry-testi' );
|
157 |
-
$post_columns['shortcode'] = esc_html__( 'Shortcode', 'cherry-testi' );
|
158 |
-
|
159 |
-
// Return the columns.
|
160 |
-
return $post_columns;
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Add output for custom columns on the "menu items" screen.
|
165 |
-
*
|
166 |
-
* @since 1.0.0
|
167 |
-
* @param string $column The name of the column to display.
|
168 |
-
* @param int $post_id The ID of the current post.
|
169 |
-
*/
|
170 |
-
public function custom_column( $column, $post_id ) {
|
171 |
-
static $prefix = '';
|
172 |
-
|
173 |
-
if ( '' === $prefix ) {
|
174 |
-
$shortcode = TM_Testimonials_Shortcode::get_instance();
|
175 |
-
$prefix = $shortcode->get_prefix();
|
176 |
-
}
|
177 |
-
|
178 |
-
require_once( TM_TESTI_DIR . 'public/includes/class-tm-testimonials-template-callbacks.php' );
|
179 |
-
|
180 |
-
$callbacks = new TM_Testimonials_Template_Callbacks( array( 'size' => 50 ) );
|
181 |
-
|
182 |
-
switch ( $column ) {
|
183 |
-
case 'author_name':
|
184 |
-
$name = $callbacks->get_name();
|
185 |
-
echo empty( $name ) ? '—' : $name;
|
186 |
-
break;
|
187 |
-
|
188 |
-
case 'thumbnail':
|
189 |
-
$avatar = $callbacks->get_avatar();
|
190 |
-
echo empty( $avatar ) ? '—' : $avatar;
|
191 |
-
break;
|
192 |
-
|
193 |
-
case 'position':
|
194 |
-
$position = $callbacks->get_position();
|
195 |
-
echo empty( $position ) ? '—' : $position;
|
196 |
-
break;
|
197 |
-
|
198 |
-
case 'company_name':
|
199 |
-
$company_name = $callbacks->get_company();
|
200 |
-
echo empty( $company_name ) ? '—' : $company_name;
|
201 |
-
break;
|
202 |
-
|
203 |
-
case 'shortcode':
|
204 |
-
echo '<input style="width:100%" type="text" onfocus="this.select();" readonly="readonly" value="[' . $prefix . 'testimonials ids="' . $post_id . '"]">';
|
205 |
-
break;
|
206 |
-
|
207 |
-
default :
|
208 |
-
break;
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Modify the quick links.
|
214 |
-
*
|
215 |
-
* @since 1.0.1
|
216 |
-
* @param array $actions An array of row action links.
|
217 |
-
* @param WP_Post $post The post object.
|
218 |
-
* @return array
|
219 |
-
*/
|
220 |
-
public function modify_row_actions( $actions, $post ) {
|
221 |
-
|
222 |
-
if ( $post->post_type == $this->post_type && isset( $actions['inline hide-if-no-js'] ) ) {
|
223 |
-
|
224 |
-
// Remove `Quick Edit`.
|
225 |
-
unset( $actions['inline hide-if-no-js'] );
|
226 |
-
}
|
227 |
-
|
228 |
-
return $actions;
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Print styles.
|
233 |
-
*
|
234 |
-
* @since 1.0.0
|
235 |
-
*/
|
236 |
-
public function print_styles() {
|
237 |
-
?>
|
238 |
-
<style type="text/css">
|
239 |
-
.tm-testi-ui-container { padding-right: 0; padding-left: 0; }
|
240 |
-
.tm-testi-ui-container .cherry-control__content { flex: auto; }
|
241 |
-
</style>
|
242 |
-
<?php }
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Returns the instance.
|
246 |
-
*
|
247 |
-
* @since 1.0.0
|
248 |
-
* @return object
|
249 |
-
*/
|
250 |
-
public static function get_instance() {
|
251 |
-
|
252 |
-
// If the single instance hasn't been set, set it now.
|
253 |
-
if ( null == self::$instance ) {
|
254 |
-
self::$instance = new self;
|
255 |
-
}
|
256 |
-
|
257 |
-
return self::$instance;
|
258 |
-
}
|
259 |
-
}
|
260 |
-
|
261 |
-
TM_Testimonials_Admin::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sets up the admin functionality for the plugin.
|
4 |
+
*
|
5 |
+
* @package Cherry_Testi
|
6 |
+
* @subpackage Admin
|
7 |
+
* @author Template Monster
|
8 |
+
* @license GPL-3.0+
|
9 |
+
* @copyright 2002-2016, Template Monster
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class for Testimonials admin functionality.
|
14 |
+
*
|
15 |
+
* @since 1.0.0
|
16 |
+
*/
|
17 |
+
class TM_Testimonials_Admin {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Holds the instances of this class.
|
21 |
+
*
|
22 |
+
* @since 1.0.0
|
23 |
+
* @var object
|
24 |
+
*/
|
25 |
+
private static $instance = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Sets up needed actions/filters for the admin to initialize.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
* @return void
|
32 |
+
*/
|
33 |
+
public function __construct() {
|
34 |
+
$this->plugin = tm_testimonials_plugin();
|
35 |
+
$this->post_type = $this->plugin->get_post_type_name();
|
36 |
+
|
37 |
+
// Load post meta boxes on the post editing screen.
|
38 |
+
add_action( 'load-post.php', array( $this, 'metabox' ) );
|
39 |
+
add_action( 'load-post-new.php', array( $this, 'metabox' ) );
|
40 |
+
|
41 |
+
// Only run our customization on the 'edit.php' page in the admin.
|
42 |
+
add_action( 'load-edit.php', array( $this, 'manage_columns' ) );
|
43 |
+
|
44 |
+
// Modify the quick links in admin table list.
|
45 |
+
add_filter( 'post_row_actions', array( $this, 'modify_row_actions' ), 10, 2 );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Init `cherry-post-meta` module on the `Add New Testimonial` and `Edit Testimonial` screens.
|
50 |
+
*
|
51 |
+
* @since 1.0.0
|
52 |
+
*/
|
53 |
+
public function metabox() {
|
54 |
+
$screen = get_current_screen();
|
55 |
+
|
56 |
+
if ( empty( $screen->post_type ) || $this->post_type !== $screen->post_type ) {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
|
60 |
+
// Print custom styles.
|
61 |
+
add_action( 'admin_head', array( $this, 'print_styles' ) );
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Filter the array of metabox's fields.
|
65 |
+
*
|
66 |
+
* @since 1.0.0
|
67 |
+
*/
|
68 |
+
$metabox_args = apply_filters( 'tm_testimonials_metabox_args', array(
|
69 |
+
'id' => 'tm-testi-options',
|
70 |
+
'title' => esc_html__( 'Testimonial Options', 'cherry-testi' ),
|
71 |
+
'page' => $this->post_type,
|
72 |
+
'context' => 'side',
|
73 |
+
'priority' => 'core',
|
74 |
+
'callback_args' => false,
|
75 |
+
'single' => array( 'key' => TM_TESTI_POSTMETA ),
|
76 |
+
'fields' => array(
|
77 |
+
'email' => array(
|
78 |
+
'id' => TM_TESTI_POSTMETA . 'email',
|
79 |
+
'name' => TM_TESTI_POSTMETA . '[email]',
|
80 |
+
'type' => 'text',
|
81 |
+
'label' => esc_html__( 'Email:', 'cherry-testi' ),
|
82 |
+
'placeholder' => esc_html__( 'email@demolink.org', 'cherry-testi' ),
|
83 |
+
'value' => '',
|
84 |
+
'master' => 'tm-testi-ui-container',
|
85 |
+
),
|
86 |
+
'url' => array(
|
87 |
+
'id' => TM_TESTI_POSTMETA . 'url',
|
88 |
+
'name' => TM_TESTI_POSTMETA . '[url]',
|
89 |
+
'type' => 'text',
|
90 |
+
'label' => esc_html__( 'URL:', 'cherry-testi' ),
|
91 |
+
'placeholder' => esc_html__( 'http://demolink.org', 'cherry-testi' ),
|
92 |
+
'value' => '',
|
93 |
+
'master' => 'tm-testi-ui-container',
|
94 |
+
),
|
95 |
+
'position' => array(
|
96 |
+
'id' => TM_TESTI_POSTMETA . 'position',
|
97 |
+
'name' => TM_TESTI_POSTMETA . '[position]',
|
98 |
+
'type' => 'text',
|
99 |
+
'label' => esc_html__( 'Position:', 'cherry-testi' ),
|
100 |
+
'placeholder' => esc_html__( 'CEO/Founder', 'cherry-testi' ),
|
101 |
+
'value' => '',
|
102 |
+
'master' => 'tm-testi-ui-container',
|
103 |
+
),
|
104 |
+
'company' => array(
|
105 |
+
'id' => TM_TESTI_POSTMETA . 'company',
|
106 |
+
'name' => TM_TESTI_POSTMETA . '[company]',
|
107 |
+
'type' => 'text',
|
108 |
+
'label' => esc_html__( 'Company Name:', 'cherry-testi' ),
|
109 |
+
'placeholder' => esc_html__( 'Demo & Co', 'cherry-testi' ),
|
110 |
+
'value' => '',
|
111 |
+
'master' => 'tm-testi-ui-container',
|
112 |
+
),
|
113 |
+
),
|
114 |
+
) );
|
115 |
+
|
116 |
+
$this->plugin->get_core()->init_module( 'cherry-post-meta', $metabox_args );
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Adds a custom filter on 'request' when viewing the `Testimonials` screen in the admin.
|
121 |
+
*
|
122 |
+
* @since 1.0.0
|
123 |
+
*/
|
124 |
+
public function manage_columns() {
|
125 |
+
$screen = get_current_screen();
|
126 |
+
|
127 |
+
if ( empty( $screen->post_type ) || $this->post_type !== $screen->post_type ) {
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
|
131 |
+
// Modify the columns on the `Testimonials` screen.
|
132 |
+
add_filter( "manage_edit-{$this->post_type}_columns", array( $this, 'columns' ) );
|
133 |
+
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'custom_column' ), 10, 2 );
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Filters the columns on the `Testimonials` screen.
|
138 |
+
*
|
139 |
+
* @since 1.0.0
|
140 |
+
* @param array $post_columns An array of column name => label.
|
141 |
+
* @return array
|
142 |
+
*/
|
143 |
+
public function columns( $post_columns ) {
|
144 |
+
|
145 |
+
unset(
|
146 |
+
$post_columns['author'],
|
147 |
+
$post_columns[ 'taxonomy-' . $this->post_type . '_category' ],
|
148 |
+
$post_columns['date']
|
149 |
+
);
|
150 |
+
|
151 |
+
// Add custom columns and overwrite the 'date' column.
|
152 |
+
$post_columns['thumbnail'] = esc_html__( 'Avatar', 'cherry-testi' );
|
153 |
+
$post_columns['author_name'] = esc_html__( 'Author Name', 'cherry-testi' );
|
154 |
+
$post_columns['position'] = esc_html__( 'Position', 'cherry-testi' );
|
155 |
+
$post_columns['company_name'] = esc_html__( 'Company Name', 'cherry-testi' );
|
156 |
+
$post_columns[ 'taxonomy-' . $this->post_type . '_category' ] = esc_html__( 'Category', 'cherry-testi' );
|
157 |
+
$post_columns['shortcode'] = esc_html__( 'Shortcode', 'cherry-testi' );
|
158 |
+
|
159 |
+
// Return the columns.
|
160 |
+
return $post_columns;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Add output for custom columns on the "menu items" screen.
|
165 |
+
*
|
166 |
+
* @since 1.0.0
|
167 |
+
* @param string $column The name of the column to display.
|
168 |
+
* @param int $post_id The ID of the current post.
|
169 |
+
*/
|
170 |
+
public function custom_column( $column, $post_id ) {
|
171 |
+
static $prefix = '';
|
172 |
+
|
173 |
+
if ( '' === $prefix ) {
|
174 |
+
$shortcode = TM_Testimonials_Shortcode::get_instance();
|
175 |
+
$prefix = $shortcode->get_prefix();
|
176 |
+
}
|
177 |
+
|
178 |
+
require_once( TM_TESTI_DIR . 'public/includes/class-tm-testimonials-template-callbacks.php' );
|
179 |
+
|
180 |
+
$callbacks = new TM_Testimonials_Template_Callbacks( array( 'size' => 50 ) );
|
181 |
+
|
182 |
+
switch ( $column ) {
|
183 |
+
case 'author_name':
|
184 |
+
$name = $callbacks->get_name();
|
185 |
+
echo empty( $name ) ? '—' : $name;
|
186 |
+
break;
|
187 |
+
|
188 |
+
case 'thumbnail':
|
189 |
+
$avatar = $callbacks->get_avatar();
|
190 |
+
echo empty( $avatar ) ? '—' : $avatar;
|
191 |
+
break;
|
192 |
+
|
193 |
+
case 'position':
|
194 |
+
$position = $callbacks->get_position();
|
195 |
+
echo empty( $position ) ? '—' : $position;
|
196 |
+
break;
|
197 |
+
|
198 |
+
case 'company_name':
|
199 |
+
$company_name = $callbacks->get_company();
|
200 |
+
echo empty( $company_name ) ? '—' : $company_name;
|
201 |
+
break;
|
202 |
+
|
203 |
+
case 'shortcode':
|
204 |
+
echo '<input style="width:100%" type="text" onfocus="this.select();" readonly="readonly" value="[' . $prefix . 'testimonials ids="' . $post_id . '"]">';
|
205 |
+
break;
|
206 |
+
|
207 |
+
default :
|
208 |
+
break;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Modify the quick links.
|
214 |
+
*
|
215 |
+
* @since 1.0.1
|
216 |
+
* @param array $actions An array of row action links.
|
217 |
+
* @param WP_Post $post The post object.
|
218 |
+
* @return array
|
219 |
+
*/
|
220 |
+
public function modify_row_actions( $actions, $post ) {
|
221 |
+
|
222 |
+
if ( $post->post_type == $this->post_type && isset( $actions['inline hide-if-no-js'] ) ) {
|
223 |
+
|
224 |
+
// Remove `Quick Edit`.
|
225 |
+
unset( $actions['inline hide-if-no-js'] );
|
226 |
+
}
|
227 |
+
|
228 |
+
return $actions;
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Print styles.
|
233 |
+
*
|
234 |
+
* @since 1.0.0
|
235 |
+
*/
|
236 |
+
public function print_styles() {
|
237 |
+
?>
|
238 |
+
<style type="text/css">
|
239 |
+
.tm-testi-ui-container { padding-right: 0; padding-left: 0; }
|
240 |
+
.tm-testi-ui-container .cherry-control__content { flex: auto; }
|
241 |
+
</style>
|
242 |
+
<?php }
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Returns the instance.
|
246 |
+
*
|
247 |
+
* @since 1.0.0
|
248 |
+
* @return object
|
249 |
+
*/
|
250 |
+
public static function get_instance() {
|
251 |
+
|
252 |
+
// If the single instance hasn't been set, set it now.
|
253 |
+
if ( null == self::$instance ) {
|
254 |
+
self::$instance = new self;
|
255 |
+
}
|
256 |
+
|
257 |
+
return self::$instance;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
TM_Testimonials_Admin::get_instance();
|
admin/includes/class-tm-testimonials-ajax.php
CHANGED
@@ -1,109 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Ajax-handlers for page settings.
|
4 |
-
*
|
5 |
-
* @package Cherry_Testi
|
6 |
-
* @subpackage Admin
|
7 |
-
* @author Template Monster
|
8 |
-
* @license GPL-3.0+
|
9 |
-
* @copyright 2002-2016, Template Monster
|
10 |
-
*/
|
11 |
-
|
12 |
-
// If class `TM_Testimonials_Ajax_Handler` doesn't exists yet.
|
13 |
-
if ( ! class_exists( 'TM_Testimonials_Ajax_Handler' ) ) {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* TM_Testimonials_Ajax_Handler class.
|
17 |
-
*/
|
18 |
-
class TM_Testimonials_Ajax_Handler {
|
19 |
-
|
20 |
-
/**
|
21 |
-
* A reference to an instance of this class.
|
22 |
-
*
|
23 |
-
* @since 1.0.0
|
24 |
-
* @var object
|
25 |
-
*/
|
26 |
-
private static $instance = null;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Constructor.
|
30 |
-
*
|
31 |
-
* @since 1.0.0
|
32 |
-
*/
|
33 |
-
public function __construct() {
|
34 |
-
$this->init();
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Init `cherry-handler` module.
|
39 |
-
*
|
40 |
-
* @since 1.0.0
|
41 |
-
*/
|
42 |
-
public function init() {
|
43 |
-
tm_testimonials_plugin()->get_core()->init_module( 'cherry-handler', array(
|
44 |
-
'id' => 'cherry_testi_save_setting',
|
45 |
-
'action' => 'cherry_testi_save_setting',
|
46 |
-
'capability' => 'manage_options',
|
47 |
-
'callback' => array( $this, 'save_handler' ),
|
48 |
-
'sys_messages' => array(
|
49 |
-
'invalid_base_data' => esc_html__( 'Unable to process the request without nonce or server error', 'cherry-testi' ),
|
50 |
-
'no_right' => esc_html__( 'No capabilities for this action', 'cherry-testi' ),
|
51 |
-
'invalid_nonce' => esc_html__( 'Sorry, you are not allowed to save settings', 'cherry-testi' ),
|
52 |
-
'access_is_allowed' => esc_html__( 'Settings save successfully','cherry-testi' ),
|
53 |
-
),
|
54 |
-
) );
|
55 |
-
|
56 |
-
tm_testimonials_plugin()->get_core()->init_module( 'cherry-handler', array(
|
57 |
-
'id' => 'cherry_testi_reset_setting',
|
58 |
-
'action' => 'cherry_testi_reset_setting',
|
59 |
-
'capability' => 'manage_options',
|
60 |
-
'callback' => array( $this, 'reset_handler' ),
|
61 |
-
'sys_messages' => array(
|
62 |
-
'invalid_base_data' => esc_html__( 'Unable to process the request without nonce or server error', 'cherry-testi' ),
|
63 |
-
'no_right' => esc_html__( 'No capabilities for this action', 'cherry-testi' ),
|
64 |
-
'invalid_nonce' => esc_html__( 'Sorry, you are not allowed to save settings', 'cherry-testi' ),
|
65 |
-
'access_is_allowed' => esc_html__( 'Settings reset successfully','cherry-testi' ),
|
66 |
-
),
|
67 |
-
) );
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Handler for save settings option.
|
72 |
-
*
|
73 |
-
* @since 1.0.0
|
74 |
-
*/
|
75 |
-
public function save_handler() {
|
76 |
-
|
77 |
-
if ( ! empty( $_REQUEST['data'] ) ) {
|
78 |
-
update_option( 'cherry-testi', $_REQUEST['data'] );
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Handler for reset settings option to default.
|
84 |
-
*
|
85 |
-
* @since 1.0.0
|
86 |
-
*/
|
87 |
-
public function reset_handler() {
|
88 |
-
delete_option( 'cherry-testi' );
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Returns the instance.
|
93 |
-
*
|
94 |
-
* @since 1.0.0
|
95 |
-
* @return object
|
96 |
-
*/
|
97 |
-
public static function get_instance() {
|
98 |
-
|
99 |
-
// If the single instance hasn't been set, set it now.
|
100 |
-
if ( null == self::$instance ) {
|
101 |
-
self::$instance = new self;
|
102 |
-
}
|
103 |
-
|
104 |
-
return self::$instance;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
TM_Testimonials_Ajax_Handler::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax-handlers for page settings.
|
4 |
+
*
|
5 |
+
* @package Cherry_Testi
|
6 |
+
* @subpackage Admin
|
7 |
+
* @author Template Monster
|
8 |
+
* @license GPL-3.0+
|
9 |
+
* @copyright 2002-2016, Template Monster
|
10 |
+
*/
|
11 |
+
|
12 |
+
// If class `TM_Testimonials_Ajax_Handler` doesn't exists yet.
|
13 |
+
if ( ! class_exists( 'TM_Testimonials_Ajax_Handler' ) ) {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* TM_Testimonials_Ajax_Handler class.
|
17 |
+
*/
|
18 |
+
class TM_Testimonials_Ajax_Handler {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A reference to an instance of this class.
|
22 |
+
*
|
23 |
+
* @since 1.0.0
|
24 |
+
* @var object
|
25 |
+
*/
|
26 |
+
private static $instance = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor.
|
30 |
+
*
|
31 |
+
* @since 1.0.0
|
32 |
+
*/
|
33 |
+
public function __construct() {
|
34 |
+
$this->init();
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Init `cherry-handler` module.
|
39 |
+
*
|
40 |
+
* @since 1.0.0
|
41 |
+
*/
|
42 |
+
public function init() {
|
43 |
+
tm_testimonials_plugin()->get_core()->init_module( 'cherry-handler', array(
|
44 |
+
'id' => 'cherry_testi_save_setting',
|
45 |
+
'action' => 'cherry_testi_save_setting',
|
46 |
+
'capability' => 'manage_options',
|
47 |
+
'callback' => array( $this, 'save_handler' ),
|
48 |
+
'sys_messages' => array(
|
49 |
+
'invalid_base_data' => esc_html__( 'Unable to process the request without nonce or server error', 'cherry-testi' ),
|
50 |
+
'no_right' => esc_html__( 'No capabilities for this action', 'cherry-testi' ),
|
51 |
+
'invalid_nonce' => esc_html__( 'Sorry, you are not allowed to save settings', 'cherry-testi' ),
|
52 |
+
'access_is_allowed' => esc_html__( 'Settings save successfully','cherry-testi' ),
|
53 |
+
),
|
54 |
+
) );
|
55 |
+
|
56 |
+
tm_testimonials_plugin()->get_core()->init_module( 'cherry-handler', array(
|
57 |
+
'id' => 'cherry_testi_reset_setting',
|
58 |
+
'action' => 'cherry_testi_reset_setting',
|
59 |
+
'capability' => 'manage_options',
|
60 |
+
'callback' => array( $this, 'reset_handler' ),
|
61 |
+
'sys_messages' => array(
|
62 |
+
'invalid_base_data' => esc_html__( 'Unable to process the request without nonce or server error', 'cherry-testi' ),
|
63 |
+
'no_right' => esc_html__( 'No capabilities for this action', 'cherry-testi' ),
|
64 |
+
'invalid_nonce' => esc_html__( 'Sorry, you are not allowed to save settings', 'cherry-testi' ),
|
65 |
+
'access_is_allowed' => esc_html__( 'Settings reset successfully','cherry-testi' ),
|
66 |
+
),
|
67 |
+
) );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Handler for save settings option.
|
72 |
+
*
|
73 |
+
* @since 1.0.0
|
74 |
+
*/
|
75 |
+
public function save_handler() {
|
76 |
+
|
77 |
+
if ( ! empty( $_REQUEST['data'] ) ) {
|
78 |
+
update_option( 'cherry-testi', $_REQUEST['data'] );
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Handler for reset settings option to default.
|
84 |
+
*
|
85 |
+
* @since 1.0.0
|
86 |
+
*/
|
87 |
+
public function reset_handler() {
|
88 |
+
delete_option( 'cherry-testi' );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Returns the instance.
|
93 |
+
*
|
94 |
+
* @since 1.0.0
|
95 |
+
* @return object
|
96 |
+
*/
|
97 |
+
public static function get_instance() {
|
98 |
+
|
99 |
+
// If the single instance hasn't been set, set it now.
|
100 |
+
if ( null == self::$instance ) {
|
101 |
+
self::$instance = new self;
|
102 |
+
}
|
103 |
+
|
104 |
+
return self::$instance;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
TM_Testimonials_Ajax_Handler::get_instance();
|
admin/includes/index.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Silence is golden
|
4 |
-
*
|
5 |
-
* @package Cherry_Testi
|
6 |
-
* @author Template Monster
|
7 |
-
* @license GPL-3.0+
|
8 |
-
* @copyright 2002-2016, Template Monster
|
9 |
-
*/
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Silence is golden
|
4 |
+
*
|
5 |
+
* @package Cherry_Testi
|
6 |
+
* @author Template Monster
|
7 |
+
* @license GPL-3.0+
|
8 |
+
* @copyright 2002-2016, Template Monster
|
9 |
+
*/
|
admin/index.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Silence is golden
|
4 |
-
*
|
5 |
-
* @package Cherry_Testi
|
6 |
-
* @author Template Monster
|
7 |
-
* @license GPL-3.0+
|
8 |
-
* @copyright 2002-2016, Template Monster
|
9 |
-
*/
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Silence is golden
|
4 |
+
*
|
5 |
+
* @package Cherry_Testi
|
6 |
+
* @author Template Monster
|
7 |
+
* @license GPL-3.0+
|
8 |
+
* @copyright 2002-2016, Template Monster
|
9 |
+
*/
|
admin/views/shortcode-settings.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Shortcode settings view.
|
4 |
-
*
|
5 |
-
* @package Cherry_Testi
|
6 |
-
* @subpackage Views
|
7 |
-
* @author Template Monster
|
8 |
-
* @license GPL-3.0+
|
9 |
-
* @copyright 2002-2016, Template Monster
|
10 |
-
*/
|
11 |
-
|
12 |
-
$
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
$code_text .= sprintf( ' %s="%s"', esc_html( $key ), $
|
23 |
-
$list
|
24 |
-
}
|
25 |
-
|
26 |
-
printf( '<code>[%1$s%2$s%
|
27 |
-
printf( '<h4 class="cherry-testi-shortcode-title">%s</h4><ul class="cherry-testi-shortcode-params">%s</ul>', esc_html__( 'Parameters list:', '
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode settings view.
|
4 |
+
*
|
5 |
+
* @package Cherry_Testi
|
6 |
+
* @subpackage Views
|
7 |
+
* @author Template Monster
|
8 |
+
* @license GPL-3.0+
|
9 |
+
* @copyright 2002-2016, Template Monster
|
10 |
+
*/
|
11 |
+
|
12 |
+
$atts = tm_testimonials_shortcode()->get_shortcode_atts();
|
13 |
+
|
14 |
+
if ( empty( $atts ) || ! is_array( $atts ) ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
$code_text = $list = '';
|
19 |
+
|
20 |
+
foreach ( $atts as $key => $attr ) {
|
21 |
+
$default = isset( $attr['default'] ) ? $attr['default'] : $attr['value'];
|
22 |
+
$code_text .= sprintf( ' %s="%s"', esc_html( $key ), $default );
|
23 |
+
$list .= sprintf( '<li><strong class="cherry-testi-shortcode-params__name">%s</strong> - %s</li>', esc_html( $key ), $attr['description'] );
|
24 |
+
}
|
25 |
+
|
26 |
+
printf( '<code>[%1$s%2$s%]</code>', tm_testimonials_shortcode()->get_tag(), $code_text );
|
27 |
+
printf( '<h4 class="cherry-testi-shortcode-title">%s</h4><ul class="cherry-testi-shortcode-params">%s</ul>', esc_html__( 'Parameters list:', 'cherry-testi' ), $list );
|
cherry-framework/cherry-core.php
CHANGED
@@ -1,496 +1,469 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Class Cherry Core
|
4 |
-
* Version: 1.3
|
5 |
-
*
|
6 |
-
* @package Cherry_Framework
|
7 |
-
* @subpackage Class
|
8 |
-
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
-
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
-
* @link http://www.cherryframework.com/
|
11 |
-
* @license http://www.gnu.org/licenses/
|
12 |
-
*/
|
13 |
-
|
14 |
-
// If this file is called directly, abort.
|
15 |
-
if ( ! defined( 'WPINC' ) ) {
|
16 |
-
die;
|
17 |
-
}
|
18 |
-
|
19 |
-
if ( ! class_exists( 'Cherry_Core' ) ) {
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Class Cherry Core.
|
23 |
-
*/
|
24 |
-
class Cherry_Core {
|
25 |
-
|
26 |
-
/**
|
27 |
-
* A reference to an instance of this class.
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
* @var object
|
31 |
-
*/
|
32 |
-
private static $instance = null;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Core settings.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
* @var array
|
39 |
-
*/
|
40 |
-
public $settings = array();
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Holder for all registered modules for current core instance.
|
44 |
-
*
|
45 |
-
* @since 1.0.0
|
46 |
-
* @var array
|
47 |
-
*/
|
48 |
-
public $modules = array();
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Holder for all modules.
|
52 |
-
*
|
53 |
-
* @since 1.1.0
|
54 |
-
* @var array
|
55 |
-
*/
|
56 |
-
public static $all_modules = array();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Constructor.
|
60 |
-
*
|
61 |
-
* @since 1.0.0
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
$
|
67 |
-
|
68 |
-
|
69 |
-
'
|
70 |
-
'
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
add_action( 'after_setup_theme', array(
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
}
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
);
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
$
|
396 |
-
}
|
397 |
-
|
398 |
-
return (
|
399 |
-
}
|
400 |
-
|
401 |
-
/**
|
402 |
-
*
|
403 |
-
*
|
404 |
-
*
|
405 |
-
* @
|
406 |
-
* @
|
407 |
-
* @
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
*
|
444 |
-
*
|
445 |
-
* @
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
return
|
467 |
-
}
|
468 |
-
|
469 |
-
|
470 |
-
* Get URI to the core directory.
|
471 |
-
*
|
472 |
-
* @since 1.0.0
|
473 |
-
* @deprecated 1.1.0 Use `base_url()` method
|
474 |
-
* @return string
|
475 |
-
*/
|
476 |
-
public function get_core_url() {
|
477 |
-
return trailingslashit( $this->settings['base_url'] );
|
478 |
-
}
|
479 |
-
|
480 |
-
/**
|
481 |
-
* Returns the instance.
|
482 |
-
*
|
483 |
-
* @since 1.0.0
|
484 |
-
* @return object
|
485 |
-
*/
|
486 |
-
public static function get_instance() {
|
487 |
-
|
488 |
-
// If the single instance hasn't been set, set it now.
|
489 |
-
if ( null == self::$instance ) {
|
490 |
-
self::$instance = new self;
|
491 |
-
}
|
492 |
-
|
493 |
-
return self::$instance;
|
494 |
-
}
|
495 |
-
}
|
496 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Cherry Core
|
4 |
+
* Version: 1.5.3
|
5 |
+
*
|
6 |
+
* @package Cherry_Framework
|
7 |
+
* @subpackage Class
|
8 |
+
* @author Cherry Team <cherryframework@gmail.com>
|
9 |
+
* @copyright Copyright (c) 2012 - 2016, Cherry Team
|
10 |
+
* @link http://www.cherryframework.com/
|
11 |
+
* @license http://www.gnu.org/licenses/gpl-3.0.en.html
|
12 |
+
*/
|
13 |
+
|
14 |
+
// If this file is called directly, abort.
|
15 |
+
if ( ! defined( 'WPINC' ) ) {
|
16 |
+
die;
|
17 |
+
}
|
18 |
+
|
19 |
+
if ( ! class_exists( 'Cherry_Core' ) ) {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Class Cherry Core.
|
23 |
+
*/
|
24 |
+
class Cherry_Core {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* A reference to an instance of this class.
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
* @var object
|
31 |
+
*/
|
32 |
+
private static $instance = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Core settings.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
* @var array
|
39 |
+
*/
|
40 |
+
public $settings = array();
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Holder for all registered modules for current core instance.
|
44 |
+
*
|
45 |
+
* @since 1.0.0
|
46 |
+
* @var array
|
47 |
+
*/
|
48 |
+
public $modules = array();
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Holder for all modules.
|
52 |
+
*
|
53 |
+
* @since 1.1.0
|
54 |
+
* @var array
|
55 |
+
*/
|
56 |
+
public static $all_modules = array();
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Constructor.
|
60 |
+
*
|
61 |
+
* @since 1.0.0
|
62 |
+
*/
|
63 |
+
public function __construct( $settings = array() ) {
|
64 |
+
global $chery_core_version;
|
65 |
+
|
66 |
+
$defaults = array(
|
67 |
+
'framework_path' => 'cherry-framework',
|
68 |
+
'modules' => array(),
|
69 |
+
'base_dir' => '',
|
70 |
+
'base_url' => '',
|
71 |
+
);
|
72 |
+
|
73 |
+
$this->settings = array_merge( $defaults, $settings );
|
74 |
+
|
75 |
+
if ( isset( $chery_core_version ) && 0 < sizeof( $chery_core_version ) ) {
|
76 |
+
$core_paths = array_values( $chery_core_version );
|
77 |
+
$path_parts = pathinfo( $core_paths[0] );
|
78 |
+
$this->settings['base_dir'] = trailingslashit( $path_parts['dirname'] );
|
79 |
+
} else {
|
80 |
+
// This condition and the using of the function dirname is due to core backwards compatibility with old framework versions
|
81 |
+
$this->settings['base_dir'] = trailingslashit( dirname( __FILE__ ) );
|
82 |
+
}
|
83 |
+
|
84 |
+
$this->settings['base_url'] = trailingslashit( $this->base_url( '', $this->settings['base_dir'] ) );
|
85 |
+
|
86 |
+
$this->run_collector();
|
87 |
+
|
88 |
+
/**
|
89 |
+
* In this hooks priority parameter are very important.
|
90 |
+
*/
|
91 |
+
add_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );
|
92 |
+
add_action( 'after_setup_theme', array( $this, 'init_required_modules' ), 2 );
|
93 |
+
|
94 |
+
// Load the framework textdomain.
|
95 |
+
add_action( 'after_setup_theme', array( $this, 'load_textdomain' ), 10 );
|
96 |
+
|
97 |
+
// Init modules with autoload seted up into true.
|
98 |
+
add_action( 'after_setup_theme', array( $this, 'init_autoload_modules' ), 9999 );
|
99 |
+
|
100 |
+
// Backward compatibility for `cherry-widget-factory` module.
|
101 |
+
remove_all_filters( 'cherry_widget_factory_core', 10 );
|
102 |
+
add_filter( 'cherry_widget_factory_core', array( $this, 'pass_core_to_widgets' ), 11, 2 );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Fire collector for modules.
|
107 |
+
*
|
108 |
+
* @since 1.0.0
|
109 |
+
* @return bool
|
110 |
+
*/
|
111 |
+
private function run_collector() {
|
112 |
+
|
113 |
+
if ( ! is_array( $this->settings['modules'] ) || empty( $this->settings['modules'] ) ) {
|
114 |
+
return false;
|
115 |
+
}
|
116 |
+
|
117 |
+
// Cherry_Toolkit module should be loaded by default.
|
118 |
+
if ( ! isset( $this->settings['modules']['cherry-toolkit'] ) ) {
|
119 |
+
$this->settings['modules']['cherry-toolkit'] = array(
|
120 |
+
'autoload' => true,
|
121 |
+
);
|
122 |
+
}
|
123 |
+
|
124 |
+
foreach ( $this->settings['modules'] as $module => $settings ) {
|
125 |
+
$file_path = $this->get_module_file( $module );
|
126 |
+
|
127 |
+
if ( ! array_key_exists( $module, self::$all_modules ) ) {
|
128 |
+
self::$all_modules[ $module ] = $file_path;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Filter a holder for all modules.
|
134 |
+
*
|
135 |
+
* @since 1.1.0
|
136 |
+
* @var array
|
137 |
+
*/
|
138 |
+
self::$all_modules = apply_filters( 'cherry_core_all_modules', self::$all_modules, $this );
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Loaded all modules.
|
143 |
+
*
|
144 |
+
* @since 1.1.0
|
145 |
+
*/
|
146 |
+
public static function load_all_modules() {
|
147 |
+
foreach ( self::$all_modules as $module => $path ) {
|
148 |
+
|
149 |
+
$loaded = self::load_module( $module, $path );
|
150 |
+
|
151 |
+
if ( ! $loaded ) {
|
152 |
+
continue;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Load the framework textdomain.
|
159 |
+
*
|
160 |
+
* @since 1.4.0
|
161 |
+
*/
|
162 |
+
public function load_textdomain() {
|
163 |
+
$mo_file_path = $this->settings['base_dir'] . 'languages/' . get_locale() . '.mo';
|
164 |
+
|
165 |
+
load_textdomain( 'cherry-framework', $mo_file_path );
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Init a required modules.
|
170 |
+
*
|
171 |
+
* @since 1.1.0
|
172 |
+
*/
|
173 |
+
public function init_required_modules() {
|
174 |
+
$required_modules = apply_filters( 'cherry_core_required_modules', array(
|
175 |
+
'cherry-toolkit',
|
176 |
+
'cherry-widget-factory',
|
177 |
+
), $this );
|
178 |
+
|
179 |
+
foreach ( $required_modules as $module ) {
|
180 |
+
|
181 |
+
if ( ! array_key_exists( $module, $this->settings['modules'] ) ) {
|
182 |
+
continue;
|
183 |
+
}
|
184 |
+
|
185 |
+
$settings = $this->settings['modules'][ $module ];
|
186 |
+
$args = ! empty( $settings['args'] ) ? $settings['args'] : array();
|
187 |
+
|
188 |
+
$this->init_module( $module, $args );
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Init autoload modules.
|
194 |
+
*
|
195 |
+
* @since 1.1.0
|
196 |
+
*/
|
197 |
+
public function init_autoload_modules() {
|
198 |
+
if ( empty( $this->modules ) ) {
|
199 |
+
return;
|
200 |
+
}
|
201 |
+
|
202 |
+
foreach ( $this->settings['modules'] as $module => $settings ) {
|
203 |
+
|
204 |
+
if ( ! $this->is_module_autoload( $module ) ) {
|
205 |
+
continue;
|
206 |
+
}
|
207 |
+
|
208 |
+
if ( ! empty( $this->modules[ $module ] ) ) {
|
209 |
+
continue;
|
210 |
+
}
|
211 |
+
|
212 |
+
$args = ! empty( $settings['args'] ) ? $settings['args'] : array();
|
213 |
+
|
214 |
+
$this->init_module( $module, $args );
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Init single module.
|
220 |
+
*
|
221 |
+
* @since 1.0.0
|
222 |
+
* @param string $module Module slug.
|
223 |
+
* @param array $args Module arguments array.
|
224 |
+
* @return mixed
|
225 |
+
*/
|
226 |
+
public function init_module( $module, $args = array() ) {
|
227 |
+
|
228 |
+
if ( empty( $args[ 'module_path' ] ) ) {
|
229 |
+
$get_module_path = $this->get_module_path( $module );
|
230 |
+
$args['module_path'] = ( $get_module_path ) ? $get_module_path : '';
|
231 |
+
}
|
232 |
+
|
233 |
+
$this->modules[ $module ] = $this->get_module_instance( $module, $args );
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Filter a single module after initialization.
|
237 |
+
*
|
238 |
+
* @since 1.1.0
|
239 |
+
*/
|
240 |
+
return apply_filters( 'cherry_core_init_module', $this->modules[ $module ], $module, $args, $this );
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Check module autoload.
|
245 |
+
*
|
246 |
+
* @since 1.0.0
|
247 |
+
* @param string $module Module slug.
|
248 |
+
* @return bool
|
249 |
+
*/
|
250 |
+
public function is_module_autoload( $module ) {
|
251 |
+
|
252 |
+
if ( empty( $this->settings['modules'][ $module ]['autoload'] ) ) {
|
253 |
+
return false;
|
254 |
+
}
|
255 |
+
|
256 |
+
return $this->settings['modules'][ $module ]['autoload'];
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Include module.
|
261 |
+
*
|
262 |
+
* @since 1.0.0
|
263 |
+
* @param string $module Module slug.
|
264 |
+
* @param string $path Module path.
|
265 |
+
* @return bool
|
266 |
+
*/
|
267 |
+
public static function load_module( $module, $path ) {
|
268 |
+
$class_name = self::get_class_name( $module );
|
269 |
+
|
270 |
+
if ( ! $path ) {
|
271 |
+
return false;
|
272 |
+
}
|
273 |
+
|
274 |
+
if ( class_exists( $class_name ) ) {
|
275 |
+
return true;
|
276 |
+
}
|
277 |
+
|
278 |
+
require_once( $path );
|
279 |
+
|
280 |
+
return true;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Get module instance.
|
285 |
+
*
|
286 |
+
* @since 1.0.0
|
287 |
+
* @param string $module Module slug.
|
288 |
+
* @param array $args Module arguments.
|
289 |
+
* @return object
|
290 |
+
*/
|
291 |
+
public function get_module_instance( $module, $args = array() ) {
|
292 |
+
$class_name = self::get_class_name( $module );
|
293 |
+
|
294 |
+
if ( ! class_exists( $class_name ) ) {
|
295 |
+
echo '<p>Class <b>' . esc_html( $class_name ) . '</b> not exist!</p>';
|
296 |
+
return false;
|
297 |
+
}
|
298 |
+
|
299 |
+
$this->modules[ $module ] = call_user_func( array( $class_name, 'get_instance' ), $this, $args );
|
300 |
+
|
301 |
+
return $this->modules[ $module ];
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Get class name by module slug.
|
306 |
+
*
|
307 |
+
* @since 1.0.0
|
308 |
+
* @param string $slug Module slug.
|
309 |
+
* @return string
|
310 |
+
*/
|
311 |
+
public static function get_class_name( $slug = '' ) {
|
312 |
+
$slug = str_replace( '-', ' ', $slug );
|
313 |
+
$class = str_replace( ' ', '_', ucwords( $slug ) );
|
314 |
+
|
315 |
+
return $class;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Get path to main file for passed module.
|
320 |
+
*
|
321 |
+
* @since 1.0.1
|
322 |
+
* @param string $module Module slug.
|
323 |
+
* @return string
|
324 |
+
*/
|
325 |
+
public function get_module_path( $module ) {
|
326 |
+
$abs_path = false;
|
327 |
+
$rel_path = 'modules/' . $module . '/';
|
328 |
+
|
329 |
+
if ( file_exists( $this->settings['base_dir'] . $rel_path ) ) {
|
330 |
+
$abs_path = $this->settings['base_dir'] . $rel_path;
|
331 |
+
}
|
332 |
+
|
333 |
+
return $abs_path;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Get path to main file for passed module.
|
338 |
+
*
|
339 |
+
* @since 1.0.1
|
340 |
+
* @param string $module Module slug.
|
341 |
+
* @return string
|
342 |
+
*/
|
343 |
+
public function get_module_file( $module ) {
|
344 |
+
$abs_path = false;
|
345 |
+
$rel_path = 'modules/' . $module . '/' . $module . '.php';
|
346 |
+
|
347 |
+
if ( file_exists( $this->settings['base_dir'] . $rel_path ) ) {
|
348 |
+
$abs_path = $this->settings['base_dir'] . $rel_path;
|
349 |
+
}
|
350 |
+
|
351 |
+
return $abs_path;
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Retrieves the absolute URL to the current file.
|
356 |
+
* Like a WordPress function `plugins_url`.
|
357 |
+
*
|
358 |
+
* @link https://codex.wordpress.org/Function_Reference/plugins_url
|
359 |
+
* @since 1.0.1
|
360 |
+
* @param string $file_path Optional. Extra path appended to the end of the URL.
|
361 |
+
* @param string $module_path A full path to the core or module file.
|
362 |
+
* @return string
|
363 |
+
*/
|
364 |
+
public static function base_url( $file_path = '', $module_path ) {
|
365 |
+
$module_path = wp_normalize_path( $module_path );
|
366 |
+
preg_match( '/\.[0-9a-z]+$/', $module_path, $ext );
|
367 |
+
|
368 |
+
if ( empty( $ext ) ) {
|
369 |
+
$module_dir = $module_path;
|
370 |
+
} else {
|
371 |
+
// This condition and the using of the function dirname is due to core backwards compatibility with old framework versions
|
372 |
+
$module_dir = dirname( $module_path );
|
373 |
+
}
|
374 |
+
|
375 |
+
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
|
376 |
+
$stylesheet = get_stylesheet();
|
377 |
+
$theme_root = get_raw_theme_root( $stylesheet );
|
378 |
+
$theme_dir = "$theme_root/$stylesheet";
|
379 |
+
|
380 |
+
if ( 0 === strpos( $module_dir, $plugin_dir ) ) {
|
381 |
+
$site_url = site_url();
|
382 |
+
$abs_path = wp_normalize_path( ABSPATH );
|
383 |
+
$url = str_replace( untrailingslashit( $abs_path ), $site_url, $module_dir );
|
384 |
+
} else if ( false !== strpos( $module_path, $theme_dir ) ) {
|
385 |
+
$explode = explode( $theme_dir, $module_dir );
|
386 |
+
$url = get_stylesheet_directory_uri() . end( $explode );
|
387 |
+
} else {
|
388 |
+
$site_url = site_url();
|
389 |
+
$abs_path = wp_normalize_path( ABSPATH );
|
390 |
+
$url = str_replace( untrailingslashit( $abs_path ), $site_url, $module_dir );
|
391 |
+
}
|
392 |
+
|
393 |
+
if ( $file_path && is_string( $file_path ) ) {
|
394 |
+
$url = trailingslashit( $url );
|
395 |
+
$url .= ltrim( $file_path, '/' );
|
396 |
+
}
|
397 |
+
|
398 |
+
return apply_filters( 'cherry_core_base_url', $url, $file_path, $module_path );
|
399 |
+
}
|
400 |
+
|
401 |
+
/**
|
402 |
+
* Pass core instance into widget.
|
403 |
+
*
|
404 |
+
* @since 1.1.0
|
405 |
+
* @param mixed $core Current core object.
|
406 |
+
* @param string $path Abstract widget file path.
|
407 |
+
* @return mixed
|
408 |
+
*/
|
409 |
+
public function pass_core_to_widgets( $core, $path ) {
|
410 |
+
$path = str_replace( '\\', '/', $path );
|
411 |
+
$current_core = str_replace( '\\', '/', $this->settings['base_dir'] );
|
412 |
+
|
413 |
+
if ( false !== strpos( $path, $current_core ) ) {
|
414 |
+
return self::get_instance();
|
415 |
+
}
|
416 |
+
|
417 |
+
return $core;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Get core version.
|
422 |
+
*
|
423 |
+
* @since 1.5.0
|
424 |
+
* @return string
|
425 |
+
*/
|
426 |
+
public function get_core_version() {
|
427 |
+
global $chery_core_version;
|
428 |
+
|
429 |
+
return key( $chery_core_version );
|
430 |
+
}
|
431 |
+
|
432 |
+
/**
|
433 |
+
* Get path to the core directory.
|
434 |
+
*
|
435 |
+
* @since 1.0.0
|
436 |
+
* @return string
|
437 |
+
*/
|
438 |
+
public function get_core_dir() {
|
439 |
+
return trailingslashit( $this->settings['base_dir'] );
|
440 |
+
}
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Get URI to the core directory.
|
444 |
+
*
|
445 |
+
* @since 1.0.0
|
446 |
+
* @deprecated 1.1.0 Use `base_url()` method
|
447 |
+
* @return string
|
448 |
+
*/
|
449 |
+
public function get_core_url() {
|
450 |
+
return trailingslashit( $this->settings['base_url'] );
|
451 |
+
}
|
452 |
+
|
453 |
+
/**
|
454 |
+
* Returns the instance.
|
455 |
+
*
|
456 |
+
* @since 1.0.0
|
457 |
+
* @return object
|
458 |
+
*/
|
459 |
+
public static function get_instance() {
|
460 |
+
|
461 |
+
// If the single instance hasn't been set, set it now.
|
462 |
+
if ( null == self::$instance ) {
|
463 |
+
self::$instance = new self;
|
464 |
+
}
|
465 |
+
|
466 |
+
return self::$instance;
|
467 |
+
}
|
468 |
+
}
|
469 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cherry-framework/config.json
CHANGED
@@ -1,174 +1,196 @@
|
|
1 |
-
{
|
2 |
-
"name" : "Cherry Framework",
|
3 |
-
"version" : "1.3.1",
|
4 |
-
"description" : "",
|
5 |
-
"doc_link" : "",
|
6 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework",
|
7 |
-
"modules" : {
|
8 |
-
"cherry-breadcrumbs" : {
|
9 |
-
"name" : "Breadcrumb Trail",
|
10 |
-
"description" : "A breadcrumb menu script for WordPress.",
|
11 |
-
"version" : "1.1.
|
12 |
-
"doc_link" : "",
|
13 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-breadcrumbs",
|
14 |
-
"compatible" : ["theme", "plugin"],
|
15 |
-
"wordpress_org" : true,
|
16 |
-
"required" : false,
|
17 |
-
"dependencies" : []
|
18 |
-
},
|
19 |
-
"cherry-customizer" : {
|
20 |
-
"name" : "Customizer API",
|
21 |
-
"description" : "Customizer functionality.",
|
22 |
-
"version" : "1.1.
|
23 |
-
"doc_link" : "",
|
24 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-customizer",
|
25 |
-
"compatible" : ["theme", "plugin"],
|
26 |
-
"wordpress_org" : true,
|
27 |
-
"required" : false,
|
28 |
-
"dependencies" : []
|
29 |
-
},
|
30 |
-
"cherry-
|
31 |
-
"name" : "
|
32 |
-
"description" : "
|
33 |
-
"version" : "1.
|
34 |
-
"doc_link" : "",
|
35 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
36 |
-
"compatible" : ["theme", "plugin"],
|
37 |
-
"wordpress_org" : true,
|
38 |
-
"required" : false,
|
39 |
-
"dependencies" : []
|
40 |
-
},
|
41 |
-
"cherry-
|
42 |
-
"name" : "
|
43 |
-
"description" : "
|
44 |
-
"version" : "1.
|
45 |
-
"doc_link" : "",
|
46 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
47 |
-
"compatible" : ["theme", "plugin"],
|
48 |
-
"wordpress_org" : true,
|
49 |
-
"required" : false,
|
50 |
-
"dependencies" : []
|
51 |
-
},
|
52 |
-
"cherry-
|
53 |
-
"name" : "
|
54 |
-
"description" : "
|
55 |
-
"version" : "1.1.0",
|
56 |
-
"doc_link" : "",
|
57 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
58 |
-
"compatible" : ["theme", "plugin"],
|
59 |
-
"wordpress_org" : true,
|
60 |
-
"required" : false,
|
61 |
-
"dependencies" : [
|
62 |
-
},
|
63 |
-
"cherry-
|
64 |
-
"name" : "
|
65 |
-
"description" : "
|
66 |
-
"version" : "1.1.
|
67 |
-
"doc_link" : "",
|
68 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
69 |
-
"compatible" : ["theme", "plugin"],
|
70 |
-
"wordpress_org" : true,
|
71 |
-
"required" : false,
|
72 |
-
"dependencies" : [ "cherry-
|
73 |
-
},
|
74 |
-
"cherry-
|
75 |
-
"name" : "
|
76 |
-
"description" : "
|
77 |
-
"version" : "1.1.2",
|
78 |
-
"doc_link" : "",
|
79 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
80 |
-
"compatible" : ["theme", "plugin"],
|
81 |
-
"wordpress_org" : true,
|
82 |
-
"required" : false,
|
83 |
-
"dependencies" : []
|
84 |
-
},
|
85 |
-
"cherry-
|
86 |
-
"name" : "
|
87 |
-
"description" : "
|
88 |
-
"version" : "1.1.2",
|
89 |
-
"doc_link" : "",
|
90 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
91 |
-
"compatible" : ["theme", "plugin"],
|
92 |
-
"wordpress_org" : true,
|
93 |
-
"required" : false,
|
94 |
-
"dependencies" : [
|
95 |
-
},
|
96 |
-
"cherry-post-
|
97 |
-
"name" : "Post
|
98 |
-
"description" : "
|
99 |
-
"version" : "1.2
|
100 |
-
"doc_link" : "",
|
101 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-
|
102 |
-
"compatible" : ["theme", "plugin"],
|
103 |
-
"wordpress_org" : true,
|
104 |
-
"required" : false,
|
105 |
-
"dependencies" : [ "cherry-
|
106 |
-
},
|
107 |
-
"cherry-
|
108 |
-
"name" : "
|
109 |
-
"description" : "
|
110 |
-
"version" : "1.
|
111 |
-
"doc_link" : "",
|
112 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-
|
113 |
-
"compatible" : ["theme", "plugin"],
|
114 |
-
"wordpress_org" : true,
|
115 |
-
"required" : false,
|
116 |
-
"dependencies" : []
|
117 |
-
},
|
118 |
-
"cherry-term-meta" : {
|
119 |
-
"name" : "Term Meta",
|
120 |
-
"description" : "Manage term metadata.",
|
121 |
-
"version" : "1.1.4",
|
122 |
-
"doc_link" : "",
|
123 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-term-meta",
|
124 |
-
"compatible" : ["theme", "plugin"],
|
125 |
-
"wordpress_org" : true,
|
126 |
-
"required" : false,
|
127 |
-
"dependencies" : [ "cherry-ui-elements" ]
|
128 |
-
},
|
129 |
-
"cherry-toolkit": {
|
130 |
-
"name": "Framework Toolkit",
|
131 |
-
"description": "Framework Toolkit contains various PHP utilities",
|
132 |
-
"version" : "1.2.0",
|
133 |
-
"doc_link": "",
|
134 |
-
"git_link": "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-toolkit",
|
135 |
-
"compatible": ["theme", "plugin"],
|
136 |
-
"wordpress_org": true,
|
137 |
-
"required": true,
|
138 |
-
"dependencies": []
|
139 |
-
},
|
140 |
-
"cherry-ui-elements" : {
|
141 |
-
"name" : "UI Elements",
|
142 |
-
"description" : "UI Elements",
|
143 |
-
"version" : "1.3
|
144 |
-
"doc_link" : "",
|
145 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
|
146 |
-
"compatible" : ["theme", "plugin"],
|
147 |
-
"wordpress_org" : true,
|
148 |
-
"required" : false,
|
149 |
-
"dependencies" : [ "cherry-js-core" ]
|
150 |
-
},
|
151 |
-
"cherry-utility" : {
|
152 |
-
"name" : "Utility",
|
153 |
-
"description" : "Multiple utility functions.",
|
154 |
-
"version" : "1.1.
|
155 |
-
"doc_link" : "",
|
156 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
|
157 |
-
"compatible" : ["theme", "plugin"],
|
158 |
-
"wordpress_org" : true,
|
159 |
-
"required" : false,
|
160 |
-
"dependencies" : []
|
161 |
-
},
|
162 |
-
"cherry-widget-factory" : {
|
163 |
-
"name" : "Widget Factory",
|
164 |
-
"description" : "Base widget class that simplifies creating of your own widgets.",
|
165 |
-
"version" : "1.2.1",
|
166 |
-
"doc_link" : "",
|
167 |
-
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-widget-factory",
|
168 |
-
"compatible" : ["theme", "plugin"],
|
169 |
-
"wordpress_org" : true,
|
170 |
-
"required" : false,
|
171 |
-
"dependencies" : [ "cherry-ui-elements" ]
|
172 |
-
}
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name" : "Cherry Framework",
|
3 |
+
"version" : "1.4.3.1",
|
4 |
+
"description" : "",
|
5 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs",
|
6 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework",
|
7 |
+
"modules" : {
|
8 |
+
"cherry-breadcrumbs" : {
|
9 |
+
"name" : "Breadcrumb Trail",
|
10 |
+
"description" : "A breadcrumb menu script for WordPress.",
|
11 |
+
"version" : "1.1.3",
|
12 |
+
"doc_link" : "",
|
13 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-breadcrumbs",
|
14 |
+
"compatible" : ["theme", "plugin"],
|
15 |
+
"wordpress_org" : true,
|
16 |
+
"required" : false,
|
17 |
+
"dependencies" : []
|
18 |
+
},
|
19 |
+
"cherry-customizer" : {
|
20 |
+
"name" : "Customizer API",
|
21 |
+
"description" : "Customizer functionality.",
|
22 |
+
"version" : "1.1.7",
|
23 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/01.%20cherry-customizer.md",
|
24 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-customizer",
|
25 |
+
"compatible" : ["theme", "plugin"],
|
26 |
+
"wordpress_org" : true,
|
27 |
+
"required" : false,
|
28 |
+
"dependencies" : []
|
29 |
+
},
|
30 |
+
"cherry-db-updater" : {
|
31 |
+
"name" : "Database Updater",
|
32 |
+
"description" : "Handle database updates if required.",
|
33 |
+
"version" : "1.0.0",
|
34 |
+
"doc_link" : "",
|
35 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-db-updater",
|
36 |
+
"compatible" : ["theme", "plugin"],
|
37 |
+
"wordpress_org" : true,
|
38 |
+
"required" : false,
|
39 |
+
"dependencies" : []
|
40 |
+
},
|
41 |
+
"cherry-dynamic-css" : {
|
42 |
+
"name" : "Dynamic CSS",
|
43 |
+
"description" : "Generate CSS.",
|
44 |
+
"version" : "1.4.0",
|
45 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/03.%20cherry-dynamic-css.md",
|
46 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-dynamic-css",
|
47 |
+
"compatible" : ["theme", "plugin"],
|
48 |
+
"wordpress_org" : true,
|
49 |
+
"required" : false,
|
50 |
+
"dependencies" : []
|
51 |
+
},
|
52 |
+
"cherry-google-fonts-loader" : {
|
53 |
+
"name" : "Google Fonts Loader",
|
54 |
+
"description" : "Enqueue Google fonts.",
|
55 |
+
"version" : "1.1.0",
|
56 |
+
"doc_link" : "",
|
57 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-google-fonts-loader",
|
58 |
+
"compatible" : ["theme", "plugin"],
|
59 |
+
"wordpress_org" : true,
|
60 |
+
"required" : false,
|
61 |
+
"dependencies" : []
|
62 |
+
},
|
63 |
+
"cherry-handler" : {
|
64 |
+
"name" : "Cherry handler",
|
65 |
+
"description" : "Initialize handlers.",
|
66 |
+
"version" : "1.1.3",
|
67 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/02.%20cherry-handler.md",
|
68 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-handler",
|
69 |
+
"compatible" : ["theme", "plugin"],
|
70 |
+
"wordpress_org" : true,
|
71 |
+
"required" : false,
|
72 |
+
"dependencies" : [ "cherry-js-core" ]
|
73 |
+
},
|
74 |
+
"cherry-interface-builder" : {
|
75 |
+
"name" : "Interface Builder",
|
76 |
+
"description" : "The module for the creation of interfaces in the WordPress admin panel.",
|
77 |
+
"version" : "1.1.2",
|
78 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/07.%20cherry-interface-builder.md",
|
79 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-interface-builder",
|
80 |
+
"compatible" : ["theme", "plugin"],
|
81 |
+
"wordpress_org" : true,
|
82 |
+
"required" : false,
|
83 |
+
"dependencies" : [ "cherry-ui-elements" ]
|
84 |
+
},
|
85 |
+
"cherry-js-core" : {
|
86 |
+
"name" : "JS Core",
|
87 |
+
"description" : "Initialize global JS object which provides additional plugin functionality.",
|
88 |
+
"version" : "1.1.2",
|
89 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/04.%20cherry-js-core.md",
|
90 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-js-core",
|
91 |
+
"compatible" : ["theme", "plugin"],
|
92 |
+
"wordpress_org" : true,
|
93 |
+
"required" : false,
|
94 |
+
"dependencies" : []
|
95 |
+
},
|
96 |
+
"cherry-post-formats-api" : {
|
97 |
+
"name" : "Post Formats API",
|
98 |
+
"description" : "API for post formats specific content.",
|
99 |
+
"version" : "1.1.2",
|
100 |
+
"doc_link" : "",
|
101 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-formats-api",
|
102 |
+
"compatible" : ["theme", "plugin"],
|
103 |
+
"wordpress_org" : true,
|
104 |
+
"required" : false,
|
105 |
+
"dependencies" : [ "cherry-js-core" ]
|
106 |
+
},
|
107 |
+
"cherry-post-meta" : {
|
108 |
+
"name" : "Post Meta",
|
109 |
+
"description" : "Manage post meta.",
|
110 |
+
"version" : "1.2.1",
|
111 |
+
"doc_link" : "",
|
112 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-post-meta",
|
113 |
+
"compatible" : ["theme", "plugin"],
|
114 |
+
"wordpress_org" : true,
|
115 |
+
"required" : false,
|
116 |
+
"dependencies" : [ "cherry-interface-builder" ]
|
117 |
+
},
|
118 |
+
"cherry-term-meta" : {
|
119 |
+
"name" : "Term Meta",
|
120 |
+
"description" : "Manage term metadata.",
|
121 |
+
"version" : "1.1.4",
|
122 |
+
"doc_link" : "",
|
123 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-term-meta",
|
124 |
+
"compatible" : ["theme", "plugin"],
|
125 |
+
"wordpress_org" : true,
|
126 |
+
"required" : false,
|
127 |
+
"dependencies" : [ "cherry-ui-elements" ]
|
128 |
+
},
|
129 |
+
"cherry-toolkit": {
|
130 |
+
"name": "Framework Toolkit",
|
131 |
+
"description": "Framework Toolkit contains various PHP utilities",
|
132 |
+
"version" : "1.2.0",
|
133 |
+
"doc_link": "https://github.com/CherryFramework/cherry-framework-docs/blob/master/100.%20cherry-toolkit.md",
|
134 |
+
"git_link": "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-toolkit",
|
135 |
+
"compatible": ["theme", "plugin"],
|
136 |
+
"wordpress_org": true,
|
137 |
+
"required": true,
|
138 |
+
"dependencies": []
|
139 |
+
},
|
140 |
+
"cherry-ui-elements" : {
|
141 |
+
"name" : "UI Elements",
|
142 |
+
"description" : "UI Elements",
|
143 |
+
"version" : "1.4.3",
|
144 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/09.%20cherry-ui-elements.md",
|
145 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
|
146 |
+
"compatible" : ["theme", "plugin"],
|
147 |
+
"wordpress_org" : true,
|
148 |
+
"required" : false,
|
149 |
+
"dependencies" : [ "cherry-js-core" ]
|
150 |
+
},
|
151 |
+
"cherry-utility" : {
|
152 |
+
"name" : "Utility",
|
153 |
+
"description" : "Multiple utility functions.",
|
154 |
+
"version" : "1.1.7",
|
155 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/08.%20cherry-utility.md",
|
156 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
|
157 |
+
"compatible" : ["theme", "plugin"],
|
158 |
+
"wordpress_org" : true,
|
159 |
+
"required" : false,
|
160 |
+
"dependencies" : []
|
161 |
+
},
|
162 |
+
"cherry-widget-factory" : {
|
163 |
+
"name" : "Widget Factory",
|
164 |
+
"description" : "Base widget class that simplifies creating of your own widgets.",
|
165 |
+
"version" : "1.2.1",
|
166 |
+
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/06.%20cherry-widget-factory.md",
|
167 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-widget-factory",
|
168 |
+
"compatible" : ["theme", "plugin"],
|
169 |
+
"wordpress_org" : true,
|
170 |
+
"required" : false,
|
171 |
+
"dependencies" : [ "cherry-ui-elements" ]
|
172 |
+
},
|
173 |
+
"cherry5-assets-loader" : {
|
174 |
+
"name" : "Assets Loader",
|
175 |
+
"description" : "The module allows you deferred loading scripts and styles.",
|
176 |
+
"version" : "1.0.0",
|
177 |
+
"doc_link" : "",
|
178 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-assets-loader",
|
179 |
+
"compatible" : [ "theme", "plugin" ],
|
180 |
+
"wordpress_org" : true,
|
181 |
+
"required" : false,
|
182 |
+
"dependencies" : [ "cherry-js-core" ]
|
183 |
+
},
|
184 |
+
"cherry5-insert-shortcode" : {
|
185 |
+
"name" : "Insert Shortcode",
|
186 |
+
"description" : "The module allows you to add shortcodes from editor tinyMCE.",
|
187 |
+
"version" : "1.0.2",
|
188 |
+
"doc_link" : "",
|
189 |
+
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-insert-shortcode",
|
190 |
+
"compatible" : [ "plugin" ],
|
191 |
+
"wordpress_org" : true,
|
192 |
+
"required" : false,
|
193 |
+
"dependencies" : [ "cherry-ui-elements", "cherry-interface-builder" ]
|
194 |
+
}
|
195 |
+
}
|
196 |
+
}
|
cherry-framework/languages/cherry-framework.pot
CHANGED
@@ -1,69 +1,119 @@
|
|
1 |
-
#, fuzzy
|
2 |
-
msgid ""
|
3 |
-
msgstr ""
|
4 |
-
"Project-Id-Version: cherry-framework\n"
|
5 |
-
"POT-Creation-Date: 2016-
|
6 |
-
"PO-Revision-Date: 2016-
|
7 |
-
"Last-Translator: \n"
|
8 |
-
"Language-Team: TemplateMonster\n"
|
9 |
-
"Language: en\n"
|
10 |
-
"MIME-Version: 1.0\n"
|
11 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
-
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit 1.8.11\n"
|
14 |
-
"X-Poedit-Basepath: ..\n"
|
15 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
-
"X-Poedit-KeywordsList: __;_e;_n:1,2;_n_noop:1,2;_x:1,2c;_nx:1,2,4c;"
|
18 |
-
"_nx_noop:1,2,3c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
|
19 |
-
"esc_html_e;esc_html_x:1,2c\n"
|
20 |
-
"X-Poedit-SearchPath-0: .\n"
|
21 |
-
"X-Poedit-SearchPath-1: .\n"
|
22 |
-
|
23 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:346
|
24 |
-
msgid "Home"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:352
|
28 |
-
msgid "Browse:"
|
29 |
-
msgstr ""
|
30 |
-
|
31 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:354
|
32 |
-
msgid "404 Not Found"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:355
|
36 |
-
msgid "Archives"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:356
|
40 |
-
#, php-format
|
41 |
-
msgid "Search results for “%s”"
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:357
|
45 |
-
#, php-format
|
46 |
-
msgid "Page %s"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:358
|
50 |
-
#, php-format
|
51 |
-
msgid "Minute %s"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:359
|
55 |
-
#, php-format
|
56 |
-
msgid "Week %s"
|
57 |
-
msgstr ""
|
58 |
-
|
59 |
-
#: modules/cherry-customizer/cherry-customizer.php:269
|
60 |
-
msgid "Untitled Panel"
|
61 |
-
msgstr ""
|
62 |
-
|
63 |
-
#: modules/cherry-customizer/cherry-customizer.php:305
|
64 |
-
msgid "Untitled Section"
|
65 |
-
msgstr ""
|
66 |
-
|
67 |
-
#: modules/cherry-customizer/cherry-customizer.php:338
|
68 |
-
msgid "Untitled Control"
|
69 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: cherry-framework\n"
|
5 |
+
"POT-Creation-Date: 2016-12-26 14:10+0200\n"
|
6 |
+
"PO-Revision-Date: 2016-12-09 16:29+0200\n"
|
7 |
+
"Last-Translator: \n"
|
8 |
+
"Language-Team: TemplateMonster\n"
|
9 |
+
"Language: en\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.8.11\n"
|
14 |
+
"X-Poedit-Basepath: ..\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_n_noop:1,2;_x:1,2c;_nx:1,2,4c;"
|
18 |
+
"_nx_noop:1,2,3c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
|
19 |
+
"esc_html_e;esc_html_x:1,2c\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
"X-Poedit-SearchPath-1: .\n"
|
22 |
+
|
23 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:346
|
24 |
+
msgid "Home"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:352
|
28 |
+
msgid "Browse:"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:354
|
32 |
+
msgid "404 Not Found"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:355
|
36 |
+
msgid "Archives"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:356
|
40 |
+
#, php-format
|
41 |
+
msgid "Search results for “%s”"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:357
|
45 |
+
#, php-format
|
46 |
+
msgid "Page %s"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:358
|
50 |
+
#, php-format
|
51 |
+
msgid "Minute %s"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: modules/cherry-breadcrumbs/cherry-breadcrumbs.php:359
|
55 |
+
#, php-format
|
56 |
+
msgid "Week %s"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: modules/cherry-customizer/cherry-customizer.php:269
|
60 |
+
msgid "Untitled Panel"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: modules/cherry-customizer/cherry-customizer.php:305
|
64 |
+
msgid "Untitled Section"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: modules/cherry-customizer/cherry-customizer.php:338
|
68 |
+
msgid "Untitled Control"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:105
|
72 |
+
#, php-format
|
73 |
+
msgid ""
|
74 |
+
"Module DB Updater init error in %s - version and slug is required arguments"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:106
|
78 |
+
msgid "We need to update your database to the latest version."
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:107
|
82 |
+
msgid "Update complete, thank you for updating to the latest version!"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:331
|
86 |
+
msgid "Start Update"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: modules/cherry-db-updater/cherry-db-updater.php:368
|
90 |
+
msgid "Data Update"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-button.php:63
|
94 |
+
msgid "Cherry shortcodes"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:128
|
98 |
+
msgid "insert shortcode"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:148
|
102 |
+
msgid "Shortcode List"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:206
|
106 |
+
msgid "Shortcode not found."
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:261
|
110 |
+
msgid "Shortcode content."
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:262
|
114 |
+
msgid "Input shortcode content."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: modules/cherry5-insert-shortcode/inc/class-cherry5-insertion-popup.php:277
|
118 |
+
msgid "Shortcode not a have options."
|
119 |
+
msgstr ""
|
cherry-framework/modules/cherry-breadcrumbs/cherry-breadcrumbs.php
ADDED