Version Description
- 2020-05-24 add - addon "Search & Filter" added
- 2020-05-24 add - addon "Post/Page Templates" added
- 2020-05-29 add - import layouts notice added.
Download this release
Release Info
Developer | pickplugins |
Plugin | Post Grid |
Version | 2.0.60 |
Comparing to | |
See all releases |
Code changes from version 2.0.59 to 2.0.60
- assets/admin/css/addons.css +46 -0
- assets/admin/images/post-templates.png +0 -0
- assets/admin/images/pro.png +0 -0
- assets/admin/images/search.png +0 -0
- assets/admin/js/jquery.lazy.js +2 -0
- assets/admin/js/scripts.js +42 -0
- assets/settings-tabs/settings-tabs.js +15 -2
- includes/classes/class-admin-notices.php +38 -0
- includes/classes/class-functions.php +10 -0
- includes/classes/class-meta-boxes.php +0 -13
- includes/classes/class-post-types.php +2 -1
- includes/classes/class-settings-tabs.php +4 -14
- includes/classes/class-settings.php +4 -5
- includes/functions-data-upgrade.php +87 -0
- includes/functions-single.php +0 -130
- includes/layout-elements/3rd-party.php +2 -2
- includes/layout-elements/simple-job-board/layout-elements.php +2646 -0
- includes/layout-elements/wck-custom-fields-and-custom-post-types-creator/layout-elements.php +7854 -0
- includes/layout-elements/wp-job-manager/layout-elements.php +1340 -0
- includes/menu/addons.php +50 -0
- includes/menu/import-layouts.php +0 -82
- includes/menu/settings.php +6 -1
- includes/metabox-post-options-hook.php +0 -162
- includes/settings-hook.php +133 -7
- post-grid.php +14 -3
- readme.txt +7 -1
- sample-data/post-grid-layouts.json +899 -0
- sample-data/post-grid-layouts.xml +55 -45
- templates/post-grid-hook.php +23 -38
- templates/single/single-template-hook.php +0 -85
assets/admin/css/addons.css
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
/* CSS Document */
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
.addon-list{}
|
7 |
+
.addon-list a{
|
8 |
+
text-decoration: none;
|
9 |
+
}
|
10 |
+
.addon-list .item{
|
11 |
+
display: inline-block;
|
12 |
+
width: 280px;
|
13 |
+
overflow: hidden;
|
14 |
+
padding: 10px;
|
15 |
+
background: #fff;
|
16 |
+
margin: 15px;
|
17 |
+
box-shadow: 0 0 3px 0px rgba(193, 193, 193, 0.5);
|
18 |
+
vertical-align: top;
|
19 |
+
}
|
20 |
+
|
21 |
+
.addon-list .addon-title{}
|
22 |
+
|
23 |
+
|
24 |
+
.addon-list .thumb-wrap{
|
25 |
+
|
26 |
+
}
|
27 |
+
.addon-list .thumb-wrap img{
|
28 |
+
width: 100%;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
.addon-list .addon-title{
|
33 |
+
margin: 10px 0;
|
34 |
+
font-size: 17px;
|
35 |
+
}
|
36 |
+
.addon-list .addon-link a{
|
37 |
+
text-decoration: none;
|
38 |
+
}
|
39 |
+
|
40 |
+
.addon-list .addon-link{}
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
|
assets/admin/images/post-templates.png
ADDED
Binary file
|
assets/admin/images/pro.png
ADDED
Binary file
|
assets/admin/images/search.png
ADDED
Binary file
|
assets/admin/js/jquery.lazy.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! jQuery & Zepto Lazy v1.7.10 - http://jquery.eisbehr.de/lazy - MIT&GPL-2.0 license - Copyright 2012-2018 Daniel 'Eisbehr' Kern */
|
2 |
+
!function(t,e){"use strict";function r(r,a,i,u,l){function f(){L=t.devicePixelRatio>1,i=c(i),a.delay>=0&&setTimeout(function(){s(!0)},a.delay),(a.delay<0||a.combined)&&(u.e=v(a.throttle,function(t){"resize"===t.type&&(w=B=-1),s(t.all)}),u.a=function(t){t=c(t),i.push.apply(i,t)},u.g=function(){return i=n(i).filter(function(){return!n(this).data(a.loadedName)})},u.f=function(t){for(var e=0;e<t.length;e++){var r=i.filter(function(){return this===t[e]});r.length&&s(!1,r)}},s(),n(a.appendScroll).on("scroll."+l+" resize."+l,u.e))}function c(t){var i=a.defaultImage,o=a.placeholder,u=a.imageBase,l=a.srcsetAttribute,f=a.loaderAttribute,c=a._f||{};t=n(t).filter(function(){var t=n(this),r=m(this);return!t.data(a.handledName)&&(t.attr(a.attribute)||t.attr(l)||t.attr(f)||c[r]!==e)}).data("plugin_"+a.name,r);for(var s=0,d=t.length;s<d;s++){var A=n(t[s]),g=m(t[s]),h=A.attr(a.imageBaseAttribute)||u;g===N&&h&&A.attr(l)&&A.attr(l,b(A.attr(l),h)),c[g]===e||A.attr(f)||A.attr(f,c[g]),g===N&&i&&!A.attr(E)?A.attr(E,i):g===N||!o||A.css(O)&&"none"!==A.css(O)||A.css(O,"url('"+o+"')")}return t}function s(t,e){if(!i.length)return void(a.autoDestroy&&r.destroy());for(var o=e||i,u=!1,l=a.imageBase||"",f=a.srcsetAttribute,c=a.handledName,s=0;s<o.length;s++)if(t||e||A(o[s])){var g=n(o[s]),h=m(o[s]),b=g.attr(a.attribute),v=g.attr(a.imageBaseAttribute)||l,p=g.attr(a.loaderAttribute);g.data(c)||a.visibleOnly&&!g.is(":visible")||!((b||g.attr(f))&&(h===N&&(v+b!==g.attr(E)||g.attr(f)!==g.attr(F))||h!==N&&v+b!==g.css(O))||p)||(u=!0,g.data(c,!0),d(g,h,v,p))}u&&(i=n(i).filter(function(){return!n(this).data(c)}))}function d(t,e,r,i){++z;var o=function(){y("onError",t),p(),o=n.noop};y("beforeLoad",t);var u=a.attribute,l=a.srcsetAttribute,f=a.sizesAttribute,c=a.retinaAttribute,s=a.removeAttribute,d=a.loadedName,A=t.attr(c);if(i){var g=function(){s&&t.removeAttr(a.loaderAttribute),t.data(d,!0),y(T,t),setTimeout(p,1),g=n.noop};t.off(I).one(I,o).one(D,g),y(i,t,function(e){e?(t.off(D),g()):(t.off(I),o())})||t.trigger(I)}else{var h=n(new Image);h.one(I,o).one(D,function(){t.hide(),e===N?t.attr(C,h.attr(C)).attr(F,h.attr(F)).attr(E,h.attr(E)):t.css(O,"url('"+h.attr(E)+"')"),t[a.effect](a.effectTime),s&&(t.removeAttr(u+" "+l+" "+c+" "+a.imageBaseAttribute),f!==C&&t.removeAttr(f)),t.data(d,!0),y(T,t),h.remove(),p()});var m=(L&&A?A:t.attr(u))||"";h.attr(C,t.attr(f)).attr(F,t.attr(l)).attr(E,m?r+m:null),h.complete&&h.trigger(D)}}function A(t){var e=t.getBoundingClientRect(),r=a.scrollDirection,n=a.threshold,i=h()+n>e.top&&-n<e.bottom,o=g()+n>e.left&&-n<e.right;return"vertical"===r?i:"horizontal"===r?o:i&&o}function g(){return w>=0?w:w=n(t).width()}function h(){return B>=0?B:B=n(t).height()}function m(t){return t.tagName.toLowerCase()}function b(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;a<n;a++)t+=e+r[a].trim()+(a!==n-1?",":"")}return t}function v(t,e){var n,i=0;return function(o,u){function l(){i=+new Date,e.call(r,o)}var f=+new Date-i;n&&clearTimeout(n),f>t||!a.enableThrottle||u?l():n=setTimeout(l,t-f)}}function p(){--z,i.length||z||y("onFinishedAll")}function y(t,e,n){return!!(t=a[t])&&(t.apply(r,[].slice.call(arguments,1)),!0)}var z=0,w=-1,B=-1,L=!1,T="afterLoad",D="load",I="error",N="img",E="src",F="srcset",C="sizes",O="background-image";"event"===a.bind||o?f():n(t).on(D+"."+l,f)}function a(a,o){var u=this,l=n.extend({},u.config,o),f={},c=l.name+"-"+ ++i;return u.config=function(t,r){return r===e?l[t]:(l[t]=r,u)},u.addItems=function(t){return f.a&&f.a("string"===n.type(t)?n(t):t),u},u.getItems=function(){return f.g?f.g():{}},u.update=function(t){return f.e&&f.e({},!t),u},u.force=function(t){return f.f&&f.f("string"===n.type(t)?n(t):t),u},u.loadAll=function(){return f.e&&f.e({all:!0},!0),u},u.destroy=function(){return n(l.appendScroll).off("."+c,f.e),n(t).off("."+c),f={},e},r(u,l,a,f,c),l.chainable?a:u}var n=t.jQuery||t.Zepto,i=0,o=!1;n.fn.Lazy=n.fn.lazy=function(t){return new a(this,t)},n.Lazy=n.lazy=function(t,r,i){if(n.isFunction(r)&&(i=r,r=[]),n.isFunction(i)){t=n.isArray(t)?t:[t],r=n.isArray(r)?r:[r];for(var o=a.prototype.config,u=o._f||(o._f={}),l=0,f=t.length;l<f;l++)(o[t[l]]===e||n.isFunction(o[t[l]]))&&(o[t[l]]=i);for(var c=0,s=r.length;c<s;c++)u[r[c]]=t[0]}},a.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:t,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:e,afterLoad:e,onError:e,onFinishedAll:e},n(t).on("load",function(){o=!0})}(window);
|
assets/admin/js/scripts.js
CHANGED
@@ -41,6 +41,48 @@ jQuery(document).ready(function($){
|
|
41 |
}
|
42 |
});
|
43 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
});
|
45 |
|
46 |
|
41 |
}
|
42 |
});
|
43 |
})
|
44 |
+
|
45 |
+
|
46 |
+
$(document).on('click', '.post-grid-import-layouts', function(event){
|
47 |
+
|
48 |
+
event.preventDefault();
|
49 |
+
|
50 |
+
xml_source = $(this).attr('href');
|
51 |
+
$(this).html('Please wait...');
|
52 |
+
|
53 |
+
|
54 |
+
console.log(xml_source);
|
55 |
+
|
56 |
+
jQuery.ajax(
|
57 |
+
{
|
58 |
+
type: 'POST',
|
59 |
+
context: this,
|
60 |
+
url: post_grid_ajax.post_grid_ajaxurl,
|
61 |
+
data: {"action": "post_grid_import_xml_layouts","source": xml_source },
|
62 |
+
success: function(response) {
|
63 |
+
var data = JSON.parse( response );
|
64 |
+
|
65 |
+
success = data['success'];
|
66 |
+
|
67 |
+
$(this).html(success);
|
68 |
+
|
69 |
+
console.log(success);
|
70 |
+
|
71 |
+
}
|
72 |
+
});
|
73 |
+
|
74 |
+
})
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
});
|
87 |
|
88 |
|
assets/settings-tabs/settings-tabs.js
CHANGED
@@ -145,6 +145,8 @@ jQuery(document).ready(function($){
|
|
145 |
side_uploader.open();
|
146 |
|
147 |
})
|
|
|
|
|
148 |
$(document).on('click','.settings-tabs .field-media-url-wrapper .clear',function(e){
|
149 |
$(this).parent().children('.media-preview-wrap').children('img').attr('src','');
|
150 |
$(this).parent().children('input').val('');
|
@@ -185,7 +187,6 @@ jQuery(document).ready(function($){
|
|
185 |
})
|
186 |
|
187 |
|
188 |
-
|
189 |
jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .collapsible .header .title-text", function() {
|
190 |
if(jQuery(this).parent().parent().hasClass("active")){
|
191 |
jQuery(this).parent().parent().removeClass("active");
|
@@ -294,10 +295,22 @@ jQuery(document).ready(function($){
|
|
294 |
|
295 |
})
|
296 |
|
|
|
297 |
|
|
|
|
|
|
|
|
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
|
300 |
|
301 |
-
|
302 |
|
303 |
});
|
145 |
side_uploader.open();
|
146 |
|
147 |
})
|
148 |
+
|
149 |
+
|
150 |
$(document).on('click','.settings-tabs .field-media-url-wrapper .clear',function(e){
|
151 |
$(this).parent().children('.media-preview-wrap').children('img').attr('src','');
|
152 |
$(this).parent().children('input').val('');
|
187 |
})
|
188 |
|
189 |
|
|
|
190 |
jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .collapsible .header .title-text", function() {
|
191 |
if(jQuery(this).parent().parent().hasClass("active")){
|
192 |
jQuery(this).parent().parent().removeClass("active");
|
295 |
|
296 |
})
|
297 |
|
298 |
+
// radio-img
|
299 |
|
300 |
+
$(document).on("click", ".radio-img label", function () {
|
301 |
+
if($(this).hasClass('disabled')){
|
302 |
+
return;
|
303 |
+
}
|
304 |
|
305 |
+
$(this).parent().children("label").removeClass("active");
|
306 |
+
$(this).addClass("active");
|
307 |
+
|
308 |
+
})
|
309 |
+
|
310 |
+
$(function() {
|
311 |
+
$('.lazy').Lazy();
|
312 |
+
});
|
313 |
|
314 |
|
|
|
315 |
|
316 |
});
|
includes/classes/class-admin-notices.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
class class_post_grid_notices{
|
5 |
+
|
6 |
+
public function __construct(){
|
7 |
+
|
8 |
+
add_action('admin_notices', array( $this, 'import_layouts' ));
|
9 |
+
|
10 |
+
}
|
11 |
+
|
12 |
+
public function import_layouts(){
|
13 |
+
|
14 |
+
$post_grid_info = get_option('post_grid_info');
|
15 |
+
$import_layouts = isset($post_grid_info['import_layouts']) ? $post_grid_info['import_layouts'] : '';
|
16 |
+
|
17 |
+
|
18 |
+
//delete_option('post_grid_info');
|
19 |
+
|
20 |
+
ob_start();
|
21 |
+
|
22 |
+
if($import_layouts != 'done'):
|
23 |
+
?>
|
24 |
+
<div class="update-nag">
|
25 |
+
<?php
|
26 |
+
echo sprintf(__('Post grid require import free layouts, please <a href="%s">click here</a> to go import page', 'post-grid-pro'), admin_url().'edit.php?post_type=post_grid&page=post-grid-settings&tab=help_support')
|
27 |
+
?>
|
28 |
+
</div>
|
29 |
+
<?php
|
30 |
+
endif;
|
31 |
+
|
32 |
+
|
33 |
+
echo ob_get_clean();
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
new class_post_grid_notices();
|
includes/classes/class-functions.php
CHANGED
@@ -53,7 +53,17 @@ class class_post_grid_functions{
|
|
53 |
return apply_filters('post_grid_post_status', $args);
|
54 |
}
|
55 |
|
|
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
public function media_source(){
|
59 |
|
53 |
return apply_filters('post_grid_post_status', $args);
|
54 |
}
|
55 |
|
56 |
+
function addons_list(){
|
57 |
|
58 |
+
$args['pro'] = array('title' => __('Post Grid Pro','post-grid'), 'thumb'=> post_grid_plugin_url.'assets/admin/images/pro.png', 'item_link' => 'https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/?ref=dashboard');
|
59 |
+
|
60 |
+
$args['search'] = array('title' => __('Search & Filter','post-grid'), 'thumb'=> post_grid_plugin_url.'assets/admin/images/search.png', 'item_link' => 'https://github.com/pickplugins/post-grid-search');
|
61 |
+
$args['post-templates'] = array('title' => __('Post/Page Templates','post-grid'), 'thumb'=>post_grid_plugin_url.'assets/admin/images/post-templates.png', 'item_link' => 'https://github.com/pickplugins/post-grid-post-templates');
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
return apply_filters('post_grid_extensions', $args);
|
66 |
+
}
|
67 |
|
68 |
public function media_source(){
|
69 |
|
includes/classes/class-meta-boxes.php
CHANGED
@@ -592,19 +592,6 @@ class post_grid_meta_boxs{
|
|
592 |
'priority' => 1,
|
593 |
'active' => ($current_tab == 'options') ? true : false,
|
594 |
);
|
595 |
-
// $post_grid_settings_tab[] = array(
|
596 |
-
// 'id' => 'layouts',
|
597 |
-
// 'title' => sprintf(__('%s Layouts','post-grid'), '<i class="fas fa-qrcode"></i>'),
|
598 |
-
// 'priority' => 2,
|
599 |
-
// 'active' => ($current_tab == 'layouts') ? true : false,
|
600 |
-
// );
|
601 |
-
// $post_grid_settings_tab[] = array(
|
602 |
-
// 'id' => 'post_template',
|
603 |
-
// 'title' => sprintf(__('%s Post template','post-grid'), '<i class="fas fa-newspaper"></i>'),
|
604 |
-
// 'priority' => 2,
|
605 |
-
// 'active' => ($current_tab == 'post_template') ? true : false,
|
606 |
-
// );
|
607 |
-
|
608 |
|
609 |
|
610 |
$post_grid_settings_tabs = apply_filters('post_grid_post_options_tabs', $post_grid_settings_tab);
|
592 |
'priority' => 1,
|
593 |
'active' => ($current_tab == 'options') ? true : false,
|
594 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
|
596 |
|
597 |
$post_grid_settings_tabs = apply_filters('post_grid_post_options_tabs', $post_grid_settings_tab);
|
includes/classes/class-post-types.php
CHANGED
@@ -98,10 +98,11 @@ class class_post_grid_post_types{
|
|
98 |
'exclude_from_search' => false,
|
99 |
'hierarchical' => false,
|
100 |
'query_var' => true,
|
101 |
-
'supports' => array( 'title' ),
|
102 |
'show_in_nav_menus' => false,
|
103 |
'show_in_menu' => 'edit.php?post_type=post_grid',
|
104 |
'menu_icon' => 'dashicons-businessman',
|
|
|
105 |
|
106 |
) )
|
107 |
);
|
98 |
'exclude_from_search' => false,
|
99 |
'hierarchical' => false,
|
100 |
'query_var' => true,
|
101 |
+
'supports' => array( 'title' ), // 'editor'
|
102 |
'show_in_nav_menus' => false,
|
103 |
'show_in_menu' => 'edit.php?post_type=post_grid',
|
104 |
'menu_icon' => 'dashicons-businessman',
|
105 |
+
//'show_in_rest' => true,
|
106 |
|
107 |
) )
|
108 |
);
|
includes/classes/class-settings-tabs.php
CHANGED
@@ -36,6 +36,9 @@ class settings_tabs_field{
|
|
36 |
wp_enqueue_script( 'code-editor' );
|
37 |
wp_enqueue_style( 'code-editor' );
|
38 |
|
|
|
|
|
|
|
39 |
wp_enqueue_editor();
|
40 |
}
|
41 |
|
@@ -1581,7 +1584,7 @@ class settings_tabs_field{
|
|
1581 |
if(!empty($thumb)):
|
1582 |
|
1583 |
?>
|
1584 |
-
<img alt="<?php echo $name; ?>" src="<?php echo $thumb; ?>">
|
1585 |
<div style="padding: 5px;" class="name"><?php echo $name; ?></div>
|
1586 |
|
1587 |
<?php
|
@@ -1603,19 +1606,6 @@ class settings_tabs_field{
|
|
1603 |
endforeach;
|
1604 |
?>
|
1605 |
</div>
|
1606 |
-
<script>
|
1607 |
-
jQuery(document).ready(function($){
|
1608 |
-
$(document).on("click", ".radio-img label", function () {
|
1609 |
-
if($(this).hasClass('disabled')){
|
1610 |
-
return;
|
1611 |
-
}
|
1612 |
-
|
1613 |
-
$(this).parent().children("label").removeClass("active");
|
1614 |
-
$(this).addClass("active");
|
1615 |
-
|
1616 |
-
})
|
1617 |
-
})
|
1618 |
-
</script>
|
1619 |
|
1620 |
<style type="text/css">
|
1621 |
.radio-img{}
|
36 |
wp_enqueue_script( 'code-editor' );
|
37 |
wp_enqueue_style( 'code-editor' );
|
38 |
|
39 |
+
wp_enqueue_script( 'jquery.lazy' );
|
40 |
+
|
41 |
+
|
42 |
wp_enqueue_editor();
|
43 |
}
|
44 |
|
1584 |
if(!empty($thumb)):
|
1585 |
|
1586 |
?>
|
1587 |
+
<img class="lazy" alt="<?php echo $name; ?>" data-src="<?php echo $thumb; ?>" src="https://i.imgur.com/72Z8sfU.gif">
|
1588 |
<div style="padding: 5px;" class="name"><?php echo $name; ?></div>
|
1589 |
|
1590 |
<?php
|
1606 |
endforeach;
|
1607 |
?>
|
1608 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
|
1610 |
<style type="text/css">
|
1611 |
.radio-img{}
|
includes/classes/class-settings.php
CHANGED
@@ -19,7 +19,6 @@ class class_post_grid_settings{
|
|
19 |
public function post_grid_menu_init() {
|
20 |
|
21 |
$post_grid_info = get_option('post_grid_info');
|
22 |
-
$import_layouts = isset($post_grid_info['import_layouts']) ? $post_grid_info['import_layouts'] : '';
|
23 |
|
24 |
|
25 |
$data_update_status = isset($post_grid_info['data_update_status']) ? $post_grid_info['data_update_status'] : 'pending';
|
@@ -28,9 +27,7 @@ class class_post_grid_settings{
|
|
28 |
add_submenu_page('edit.php?post_type=post_grid', __('Layout Editor(Old)', 'post-grid'), __('Layout Editor(Old)', 'post-grid'), 'manage_options', 'layout_editor', array( $this, 'layout_editor' ));
|
29 |
|
30 |
add_submenu_page('edit.php?post_type=post_grid', __('Settings', 'post-grid'), __('Settings', 'post-grid'), 'manage_options', 'post-grid-settings', array( $this, 'settings' ));
|
31 |
-
|
32 |
-
if($import_layouts != 'done')
|
33 |
-
add_submenu_page( 'edit.php?post_type=post_grid', __( 'Import layouts', 'post-grid' ), __( 'Import layouts', 'post-grid' ), 'manage_options', 'import_layouts', array( $this, 'import_layouts' ) );
|
34 |
|
35 |
if($data_update_status == 'pending'):
|
36 |
add_submenu_page('edit.php?post_type=post_grid', __('Data Update', 'post-grid'), __('Data Update', 'post-grid'), 'manage_options', 'data-update', array( $this, 'data_update' ));
|
@@ -46,7 +43,9 @@ class class_post_grid_settings{
|
|
46 |
include(post_grid_plugin_dir.'includes/menu/settings.php');
|
47 |
}
|
48 |
|
49 |
-
|
|
|
|
|
50 |
public function layout_editor(){
|
51 |
include(post_grid_plugin_dir.'includes/menu/layout-editor.php');
|
52 |
}
|
19 |
public function post_grid_menu_init() {
|
20 |
|
21 |
$post_grid_info = get_option('post_grid_info');
|
|
|
22 |
|
23 |
|
24 |
$data_update_status = isset($post_grid_info['data_update_status']) ? $post_grid_info['data_update_status'] : 'pending';
|
27 |
add_submenu_page('edit.php?post_type=post_grid', __('Layout Editor(Old)', 'post-grid'), __('Layout Editor(Old)', 'post-grid'), 'manage_options', 'layout_editor', array( $this, 'layout_editor' ));
|
28 |
|
29 |
add_submenu_page('edit.php?post_type=post_grid', __('Settings', 'post-grid'), __('Settings', 'post-grid'), 'manage_options', 'post-grid-settings', array( $this, 'settings' ));
|
30 |
+
add_submenu_page('edit.php?post_type=post_grid', __('Addons', 'post-grid'), __('Addons', 'post-grid'), 'manage_options', 'post-grid-addons', array( $this, 'addons' ));
|
|
|
|
|
31 |
|
32 |
if($data_update_status == 'pending'):
|
33 |
add_submenu_page('edit.php?post_type=post_grid', __('Data Update', 'post-grid'), __('Data Update', 'post-grid'), 'manage_options', 'data-update', array( $this, 'data_update' ));
|
43 |
include(post_grid_plugin_dir.'includes/menu/settings.php');
|
44 |
}
|
45 |
|
46 |
+
public function addons(){
|
47 |
+
include(post_grid_plugin_dir.'includes/menu/addons.php');
|
48 |
+
}
|
49 |
public function layout_editor(){
|
50 |
include(post_grid_plugin_dir.'includes/menu/layout-editor.php');
|
51 |
}
|
includes/functions-data-upgrade.php
CHANGED
@@ -1232,4 +1232,91 @@ function post_grid_layout_css($layout){
|
|
1232 |
|
1233 |
}
|
1234 |
|
|
|
1235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1232 |
|
1233 |
}
|
1234 |
|
1235 |
+
add_shortcode('post_grid_import_xml_layouts', 'post_grid_import_xml_layouts');
|
1236 |
|
1237 |
+
function post_grid_import_xml_layouts(){
|
1238 |
+
|
1239 |
+
$response = array();
|
1240 |
+
$user_id = get_current_user_id();
|
1241 |
+
$source = sanitize_text_field($_POST['source']);
|
1242 |
+
//$xml_source = 'http://localhost/wp/wp-content/plugins/post-grid/sample-data/post-grid-layouts.json';
|
1243 |
+
|
1244 |
+
|
1245 |
+
|
1246 |
+
|
1247 |
+
$json_obj = file_get_contents($source);
|
1248 |
+
|
1249 |
+
//$xml_json = json_encode($html_obj);
|
1250 |
+
$xml_arr = json_decode($json_obj, true);
|
1251 |
+
|
1252 |
+
|
1253 |
+
$items = $xml_arr['rss']['channel']['item'];
|
1254 |
+
|
1255 |
+
foreach ($items as $item){
|
1256 |
+
|
1257 |
+
$post_title = isset($item['title']) ? $item['title'] : '';
|
1258 |
+
$postmeta = isset($item['postmeta']) ? $item['postmeta'] : array();
|
1259 |
+
|
1260 |
+
$post_id = wp_insert_post(
|
1261 |
+
array(
|
1262 |
+
'post_title' => $post_title,
|
1263 |
+
'post_content' => '',
|
1264 |
+
'post_status' => 'draft',
|
1265 |
+
'post_type' => 'post_grid_layout',
|
1266 |
+
'post_author' => $user_id,
|
1267 |
+
)
|
1268 |
+
);
|
1269 |
+
|
1270 |
+
// echo '<br>';
|
1271 |
+
// echo $post_title. ' Created';
|
1272 |
+
// echo '<br>';
|
1273 |
+
|
1274 |
+
|
1275 |
+
foreach ($postmeta as $meta){
|
1276 |
+
|
1277 |
+
$meta_key = isset($meta['meta_key']['__cdata']) ? $meta['meta_key']['__cdata'] : '';
|
1278 |
+
$meta_value = isset($meta['meta_value']['__cdata']) ? $meta['meta_value']['__cdata'] : '';
|
1279 |
+
|
1280 |
+
// echo '<br>';
|
1281 |
+
// //var_dump(unserialize($meta_value));
|
1282 |
+
// echo '<br>';
|
1283 |
+
|
1284 |
+
|
1285 |
+
|
1286 |
+
if($meta_key == 'layout_options' || $meta_key == 'layout_elements_data' || $meta_key == 'custom_scripts' ){
|
1287 |
+
//var_dump($meta_value);
|
1288 |
+
|
1289 |
+
update_post_meta($post_id, $meta_key, unserialize($meta_value));
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
|
1296 |
+
|
1297 |
+
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
|
1301 |
+
$response['success'] = __('Import done','post-grid');
|
1302 |
+
|
1303 |
+
$post_grid_info = get_option('post_grid_info');
|
1304 |
+
|
1305 |
+
if(strpos($source, 'post-grid-pro')){
|
1306 |
+
$post_grid_info['import_pro_layouts'] = 'done';
|
1307 |
+
}else{
|
1308 |
+
$post_grid_info['import_layouts'] = 'done';
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
|
1312 |
+
update_option('post_grid_info', $post_grid_info);
|
1313 |
+
|
1314 |
+
|
1315 |
+
|
1316 |
+
echo json_encode($response);
|
1317 |
+
die();
|
1318 |
+
|
1319 |
+
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
add_action('wp_ajax_post_grid_import_xml_layouts', 'post_grid_import_xml_layouts');
|
includes/functions-single.php
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
-
|
4 |
-
//add_action('the_content','post_grid_single_post');
|
5 |
-
|
6 |
-
function post_grid_single_post($content){
|
7 |
-
|
8 |
-
$post_id = get_the_id();
|
9 |
-
$post_grid_post_settings = get_post_meta($post_id,'post_grid_post_settings', true);
|
10 |
-
|
11 |
-
$layout_id = !empty($post_grid_post_settings['layout_id']) ? (int) $post_grid_post_settings['layout_id'] : '';
|
12 |
-
|
13 |
-
//var_dump($layout_id);
|
14 |
-
|
15 |
-
if(!empty($layout_id)){
|
16 |
-
|
17 |
-
|
18 |
-
$layout_elements_data = get_post_meta( $layout_id, 'layout_elements_data', true );
|
19 |
-
$layout_custom_scripts = get_post_meta($layout_id,'custom_scripts', true);
|
20 |
-
$layout_custom_css = isset($layout_custom_scripts['custom_css']) ? $layout_custom_scripts['custom_css'] : '';
|
21 |
-
|
22 |
-
ob_start();
|
23 |
-
|
24 |
-
?>
|
25 |
-
<div class="layout-<?php echo $layout_id; ?>">
|
26 |
-
<?php
|
27 |
-
|
28 |
-
if(!empty($layout_elements_data))
|
29 |
-
foreach($layout_elements_data as $elementIndex=>$elementData){
|
30 |
-
foreach($elementData as $elementId=>$element) {
|
31 |
-
|
32 |
-
//var_dump($elementId);
|
33 |
-
|
34 |
-
$element_args['element'] = $element;
|
35 |
-
$element_args['index'] = $elementIndex;
|
36 |
-
|
37 |
-
$element_args['post_id'] = $post_id;
|
38 |
-
$element_args['layout_id'] = $layout_id;
|
39 |
-
|
40 |
-
do_action('post_grid_layout_element_' . $elementId, $element_args);
|
41 |
-
do_action('post_grid_layout_element_css_' . $elementId, $element_args);
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
}
|
48 |
-
?>
|
49 |
-
</div>
|
50 |
-
<?php if(!empty($layout_custom_css)): ?>
|
51 |
-
<style type="text/css">
|
52 |
-
<?php
|
53 |
-
echo str_replace('__ID__', 'layout-'.$layout_id, $layout_custom_css);
|
54 |
-
?>
|
55 |
-
</style>
|
56 |
-
<?php endif; ?>
|
57 |
-
<?php
|
58 |
-
$content = ob_get_clean();
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
return $content;
|
64 |
-
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
function post_grid_remove_post_title($post_title){
|
72 |
-
|
73 |
-
$post_id = get_the_ID();
|
74 |
-
|
75 |
-
$post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
|
76 |
-
$remove_post_title = isset($post_grid_post_settings['remove_post_title']) ? $post_grid_post_settings['remove_post_title'] : 'no';
|
77 |
-
|
78 |
-
|
79 |
-
if($remove_post_title =='yes' && in_the_loop()){
|
80 |
-
|
81 |
-
return '';
|
82 |
-
}
|
83 |
-
else{
|
84 |
-
return $post_title;
|
85 |
-
}
|
86 |
-
|
87 |
-
}
|
88 |
-
|
89 |
-
//add_filter('the_title','post_grid_remove_post_title');
|
90 |
-
|
91 |
-
|
92 |
-
function post_grid_remove_post_thumbnail($post_thumbnail){
|
93 |
-
|
94 |
-
$post_id = get_the_ID();
|
95 |
-
|
96 |
-
$post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
|
97 |
-
$remove_post_thumbnail = isset($post_grid_post_settings['remove_post_thumbnail']) ? $post_grid_post_settings['remove_post_thumbnail'] : 'no';
|
98 |
-
|
99 |
-
|
100 |
-
if(is_singular() && $remove_post_thumbnail == 'yes'){
|
101 |
-
|
102 |
-
return '';
|
103 |
-
}
|
104 |
-
else{
|
105 |
-
return $post_thumbnail;
|
106 |
-
}
|
107 |
-
|
108 |
-
}
|
109 |
-
|
110 |
-
//add_filter('post_thumbnail_html','post_grid_remove_post_thumbnail');
|
111 |
-
|
112 |
-
|
113 |
-
function post_grid_single_template($single_template) {
|
114 |
-
global $post;
|
115 |
-
|
116 |
-
if ($post->post_type == 'post') {
|
117 |
-
|
118 |
-
$single_template = post_grid_plugin_dir . 'templates/single/single-template-hook.php';
|
119 |
-
|
120 |
-
}
|
121 |
-
return $single_template;
|
122 |
-
}
|
123 |
-
//add_filter( 'single_template', 'post_grid_single_template' );
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/layout-elements/3rd-party.php
CHANGED
@@ -72,14 +72,14 @@ if ( is_plugin_active( 'page-visit-counter/page-visit-counter.php' ) ) {
|
|
72 |
|
73 |
|
74 |
|
75 |
-
if ( is_plugin_active( 'wck-custom-fields-and-custom-post-types-creator/wck.php' ) )
|
76 |
|
77 |
require_once( post_grid_plugin_dir . 'includes/layout-elements/wck-custom-fields-and-custom-post-types-creator/layout-elements.php');
|
78 |
}
|
79 |
|
80 |
|
81 |
|
82 |
-
if ( is_plugin_active( 'wp-job-manager/wp-job-manager.php' ) )
|
83 |
|
84 |
require_once( post_grid_plugin_dir . 'includes/layout-elements/wp-job-manager/layout-elements.php');
|
85 |
}
|
72 |
|
73 |
|
74 |
|
75 |
+
if ( is_plugin_active( 'wck-custom-fields-and-custom-post-types-creator/wck.php' ) ){
|
76 |
|
77 |
require_once( post_grid_plugin_dir . 'includes/layout-elements/wck-custom-fields-and-custom-post-types-creator/layout-elements.php');
|
78 |
}
|
79 |
|
80 |
|
81 |
|
82 |
+
if ( is_plugin_active( 'wp-job-manager/wp-job-manager.php' ) ){
|
83 |
|
84 |
require_once( post_grid_plugin_dir . 'includes/layout-elements/wp-job-manager/layout-elements.php');
|
85 |
}
|
includes/layout-elements/simple-job-board/layout-elements.php
ADDED
@@ -0,0 +1,2646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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('post_grid_layout_elements','post_grid_simplejobboard_layout_elements', 5);
|
5 |
+
|
6 |
+
function post_grid_simplejobboard_layout_elements($elements_group){
|
7 |
+
|
8 |
+
$elements_group['simplejobboard'] = array(
|
9 |
+
'group_title'=>'Simple Job Board',
|
10 |
+
'items'=>array(
|
11 |
+
'simplejobboard_job_expires'=>array('name' =>__('Job expire date','post-grid')),
|
12 |
+
'simplejobboard_category'=>array('name' =>__('Category','post-grid')),
|
13 |
+
'simplejobboard_job_type'=>array('name' =>__('Job type','post-grid')),
|
14 |
+
'simplejobboard_job_feature'=>array('name' =>__('Job feature','post-grid')),
|
15 |
+
|
16 |
+
'simplejobboard_location'=>array('name' =>__('Location','post-grid')),
|
17 |
+
'simplejobboard_company_name'=>array('name' =>__('Company name','post-grid')),
|
18 |
+
'simplejobboard_company_website'=>array('name' =>__('Company website','post-grid')),
|
19 |
+
'simplejobboard_company_tagline'=>array('name' =>__('Company tagline','post-grid')),
|
20 |
+
'simplejobboard_company_logo'=>array('name' =>__('Company logo','post-grid')),
|
21 |
+
|
22 |
+
|
23 |
+
),
|
24 |
+
);
|
25 |
+
|
26 |
+
return $elements_group;
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
add_action('post_grid_layout_element_option_simplejobboard_location','post_grid_layout_element_option_simplejobboard_location');
|
34 |
+
function post_grid_layout_element_option_simplejobboard_location($parameters){
|
35 |
+
|
36 |
+
$settings_tabs_field = new settings_tabs_field();
|
37 |
+
|
38 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
39 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
40 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
41 |
+
|
42 |
+
|
43 |
+
$max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
|
44 |
+
$separator = isset($element_data['separator']) ? $element_data['separator'] : '';
|
45 |
+
$link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
|
46 |
+
|
47 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
48 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
49 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
50 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
51 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
52 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
53 |
+
|
54 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
55 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
?>
|
60 |
+
<div class="item">
|
61 |
+
<div class="element-title header ">
|
62 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
63 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
64 |
+
|
65 |
+
<span class="expand"><?php echo __('Location','post-grid'); ?></span>
|
66 |
+
</div>
|
67 |
+
<div class="element-options options">
|
68 |
+
|
69 |
+
<?php
|
70 |
+
|
71 |
+
$args = array(
|
72 |
+
'id' => 'max_count',
|
73 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
74 |
+
'title' => __('Max count','post-grid'),
|
75 |
+
'details' => __('Write max count','post-grid'),
|
76 |
+
'type' => 'text',
|
77 |
+
'value' => $max_count,
|
78 |
+
'default' => 3,
|
79 |
+
'placeholder' => '3',
|
80 |
+
);
|
81 |
+
|
82 |
+
$settings_tabs_field->generate_field($args);
|
83 |
+
|
84 |
+
$args = array(
|
85 |
+
'id' => 'separator',
|
86 |
+
'css_id' => $element_index.'_separator',
|
87 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
88 |
+
'title' => __('Link separator','post-grid'),
|
89 |
+
'details' => __('Choose link separator.','post-grid'),
|
90 |
+
'type' => 'text',
|
91 |
+
'value' => $separator,
|
92 |
+
'default' => '',
|
93 |
+
'placeholder' => ', ',
|
94 |
+
|
95 |
+
);
|
96 |
+
|
97 |
+
$settings_tabs_field->generate_field($args);
|
98 |
+
|
99 |
+
$args = array(
|
100 |
+
'id' => 'wrapper_html',
|
101 |
+
'css_id' => $element_index.'_wrapper_html',
|
102 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
103 |
+
'title' => __('Wrapper html','post-grid'),
|
104 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Location: %s</code>','post-grid'),
|
105 |
+
'type' => 'text',
|
106 |
+
'value' => $wrapper_html,
|
107 |
+
'default' => '',
|
108 |
+
'placeholder' => 'Location: %s',
|
109 |
+
);
|
110 |
+
|
111 |
+
$settings_tabs_field->generate_field($args);
|
112 |
+
|
113 |
+
$args = array(
|
114 |
+
'id' => 'link_color',
|
115 |
+
'css_id' => $element_index.'_link_color',
|
116 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
117 |
+
'title' => __('Link color','post-grid'),
|
118 |
+
'details' => __('Choose link color.','post-grid'),
|
119 |
+
'type' => 'colorpicker',
|
120 |
+
'value' => $link_color,
|
121 |
+
'default' => '',
|
122 |
+
);
|
123 |
+
|
124 |
+
$settings_tabs_field->generate_field($args);
|
125 |
+
|
126 |
+
$args = array(
|
127 |
+
'id' => 'color',
|
128 |
+
'css_id' => $element_index.'_color',
|
129 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
130 |
+
'title' => __('Text Color','post-grid'),
|
131 |
+
'details' => __('Choose text color.','post-grid'),
|
132 |
+
'type' => 'colorpicker',
|
133 |
+
'value' => $color,
|
134 |
+
'default' => '',
|
135 |
+
);
|
136 |
+
|
137 |
+
$settings_tabs_field->generate_field($args);
|
138 |
+
|
139 |
+
$args = array(
|
140 |
+
'id' => 'font_size',
|
141 |
+
'css_id' => $element_index.'_font_size',
|
142 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
143 |
+
'title' => __('Font size','post-grid'),
|
144 |
+
'details' => __('Set font size.','post-grid'),
|
145 |
+
'type' => 'text',
|
146 |
+
'value' => $font_size,
|
147 |
+
'default' => '',
|
148 |
+
'placeholder' => '14px',
|
149 |
+
);
|
150 |
+
|
151 |
+
$settings_tabs_field->generate_field($args);
|
152 |
+
|
153 |
+
|
154 |
+
$args = array(
|
155 |
+
'id' => 'font_family',
|
156 |
+
'css_id' => $element_index.'_font_family',
|
157 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
158 |
+
'title' => __('Font family','post-grid'),
|
159 |
+
'details' => __('Set font family.','post-grid'),
|
160 |
+
'type' => 'text',
|
161 |
+
'value' => $font_family,
|
162 |
+
'default' => '',
|
163 |
+
'placeholder' => 'Open Sans',
|
164 |
+
);
|
165 |
+
|
166 |
+
$settings_tabs_field->generate_field($args);
|
167 |
+
|
168 |
+
|
169 |
+
$args = array(
|
170 |
+
'id' => 'margin',
|
171 |
+
'css_id' => $element_index.'_margin',
|
172 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
173 |
+
'title' => __('Margin','post-grid'),
|
174 |
+
'details' => __('Set margin.','post-grid'),
|
175 |
+
'type' => 'text',
|
176 |
+
'value' => $margin,
|
177 |
+
'default' => '',
|
178 |
+
'placeholder' => '5px 0',
|
179 |
+
);
|
180 |
+
|
181 |
+
$settings_tabs_field->generate_field($args);
|
182 |
+
|
183 |
+
|
184 |
+
$args = array(
|
185 |
+
'id' => 'text_align',
|
186 |
+
'css_id' => $element_index.'_text_align',
|
187 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
188 |
+
'title' => __('Text align','post-grid'),
|
189 |
+
'details' => __('Choose text align.','post-grid'),
|
190 |
+
'type' => 'select',
|
191 |
+
'value' => $text_align,
|
192 |
+
'default' => 'left',
|
193 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
194 |
+
);
|
195 |
+
|
196 |
+
$settings_tabs_field->generate_field($args);
|
197 |
+
|
198 |
+
|
199 |
+
$args = array(
|
200 |
+
'id' => 'css',
|
201 |
+
'css_id' => $element_index.'_css',
|
202 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
203 |
+
'title' => __('Custom CSS','post-grid'),
|
204 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
205 |
+
'type' => 'textarea',
|
206 |
+
'value' => $css,
|
207 |
+
'default' => '',
|
208 |
+
'placeholder' => '',
|
209 |
+
);
|
210 |
+
|
211 |
+
$settings_tabs_field->generate_field($args);
|
212 |
+
|
213 |
+
$args = array(
|
214 |
+
'id' => 'css_hover',
|
215 |
+
'css_id' => $element_index.'_css_hover',
|
216 |
+
'parent' => $input_name.'[simplejobboard_location]',
|
217 |
+
'title' => __('Hover CSS','post-grid'),
|
218 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
219 |
+
'type' => 'textarea',
|
220 |
+
'value' => $css_hover,
|
221 |
+
'default' => '',
|
222 |
+
'placeholder' => '',
|
223 |
+
);
|
224 |
+
|
225 |
+
$settings_tabs_field->generate_field($args);
|
226 |
+
|
227 |
+
|
228 |
+
ob_start();
|
229 |
+
?>
|
230 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
231 |
+
<?php
|
232 |
+
|
233 |
+
$html = ob_get_clean();
|
234 |
+
|
235 |
+
$args = array(
|
236 |
+
'id' => 'use_css',
|
237 |
+
'title' => __('Use of CSS','post-grid'),
|
238 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
239 |
+
'type' => 'custom_html',
|
240 |
+
'html' => $html,
|
241 |
+
|
242 |
+
);
|
243 |
+
|
244 |
+
$settings_tabs_field->generate_field($args);
|
245 |
+
|
246 |
+
?>
|
247 |
+
|
248 |
+
</div>
|
249 |
+
</div>
|
250 |
+
<?php
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
|
255 |
+
|
256 |
+
|
257 |
+
add_action('post_grid_layout_element_simplejobboard_location', 'post_grid_layout_element_simplejobboard_location');
|
258 |
+
|
259 |
+
function post_grid_layout_element_simplejobboard_location($args){
|
260 |
+
|
261 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
262 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
263 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
264 |
+
|
265 |
+
if(empty($post_id)) return;
|
266 |
+
|
267 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
268 |
+
$link_target = isset($element['link_target']) ? $element['link_target'] : '';
|
269 |
+
$max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
|
270 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
271 |
+
$separator = isset($element['separator']) ? $element['separator'] : ', ';
|
272 |
+
|
273 |
+
|
274 |
+
$term_list = wp_get_post_terms( $post_id, 'jobpost_location', array( 'fields' => 'all' ) );
|
275 |
+
|
276 |
+
$categories_html = '';
|
277 |
+
$term_total_count = count($term_list);
|
278 |
+
$max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
|
279 |
+
|
280 |
+
$i = 0;
|
281 |
+
foreach ($term_list as $term){
|
282 |
+
if($i >= $max_count) continue;
|
283 |
+
|
284 |
+
$term_id = isset($term->term_id) ? $term->term_id : '';
|
285 |
+
$term_name = isset($term->name) ? $term->name : '';
|
286 |
+
$term_link = get_term_link($term_id);
|
287 |
+
|
288 |
+
$categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
|
289 |
+
if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
|
290 |
+
|
291 |
+
$i++;
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
?>
|
296 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> categories ">
|
297 |
+
<?php echo sprintf($wrapper_html, $categories_html); ?>
|
298 |
+
</div>
|
299 |
+
<?php
|
300 |
+
}
|
301 |
+
|
302 |
+
|
303 |
+
|
304 |
+
|
305 |
+
|
306 |
+
add_action('post_grid_layout_element_css_simplejobboard_location', 'post_grid_layout_element_css_simplejobboard_location', 10);
|
307 |
+
function post_grid_layout_element_css_simplejobboard_location($args){
|
308 |
+
|
309 |
+
|
310 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
311 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
312 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
313 |
+
|
314 |
+
$link_color = isset($element['link_color']) ? $element['link_color'] : '';
|
315 |
+
$text_color = isset($element['text_color']) ? $element['text_color'] : '';
|
316 |
+
|
317 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
318 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
319 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
320 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : '';
|
321 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
322 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
323 |
+
?>
|
324 |
+
<style type="text/css">
|
325 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
326 |
+
<?php if(!empty($text_color)): ?>
|
327 |
+
color: <?php echo $text_color; ?>;
|
328 |
+
<?php endif; ?>
|
329 |
+
<?php if(!empty($font_size)): ?>
|
330 |
+
font-size: <?php echo $font_size; ?>;
|
331 |
+
<?php endif; ?>
|
332 |
+
<?php if(!empty($font_family)): ?>
|
333 |
+
font-family: <?php echo $font_family; ?>;
|
334 |
+
<?php endif; ?>
|
335 |
+
<?php if(!empty($margin)): ?>
|
336 |
+
margin: <?php echo $margin; ?>;
|
337 |
+
<?php endif; ?>
|
338 |
+
<?php if(!empty($text_align)): ?>
|
339 |
+
text-align: <?php echo $text_align; ?>;
|
340 |
+
<?php endif; ?>
|
341 |
+
<?php if(!empty($css)): ?>
|
342 |
+
<?php echo $css; ?>
|
343 |
+
<?php endif; ?>
|
344 |
+
}
|
345 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
|
346 |
+
<?php if(!empty($link_color)): ?>
|
347 |
+
color: <?php echo $link_color; ?>;
|
348 |
+
<?php endif; ?>
|
349 |
+
<?php if(!empty($font_size)): ?>
|
350 |
+
font-size: <?php echo $font_size; ?>;
|
351 |
+
<?php endif; ?>
|
352 |
+
<?php if(!empty($font_family)): ?>
|
353 |
+
font-family: <?php echo $font_family; ?>;
|
354 |
+
<?php endif; ?>
|
355 |
+
}
|
356 |
+
<?php if(!empty($css_hover)): ?>
|
357 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
358 |
+
<?php echo $css_hover; ?>
|
359 |
+
}
|
360 |
+
<?php endif; ?>
|
361 |
+
</style>
|
362 |
+
<?php
|
363 |
+
}
|
364 |
+
|
365 |
+
|
366 |
+
add_action('post_grid_layout_element_option_simplejobboard_category','post_grid_layout_element_option_simplejobboard_category');
|
367 |
+
function post_grid_layout_element_option_simplejobboard_category($parameters){
|
368 |
+
|
369 |
+
$settings_tabs_field = new settings_tabs_field();
|
370 |
+
|
371 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
372 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
373 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
374 |
+
|
375 |
+
|
376 |
+
$max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
|
377 |
+
$separator = isset($element_data['separator']) ? $element_data['separator'] : '';
|
378 |
+
$link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
|
379 |
+
|
380 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
381 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
382 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
383 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
384 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
385 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
386 |
+
|
387 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
388 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
389 |
+
|
390 |
+
|
391 |
+
|
392 |
+
?>
|
393 |
+
<div class="item">
|
394 |
+
<div class="element-title header ">
|
395 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
396 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
397 |
+
|
398 |
+
<span class="expand"><?php echo __('Categories','post-grid'); ?></span>
|
399 |
+
</div>
|
400 |
+
<div class="element-options options">
|
401 |
+
|
402 |
+
<?php
|
403 |
+
|
404 |
+
$args = array(
|
405 |
+
'id' => 'max_count',
|
406 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
407 |
+
'title' => __('Max count','post-grid'),
|
408 |
+
'details' => __('Write max count','post-grid'),
|
409 |
+
'type' => 'text',
|
410 |
+
'value' => $max_count,
|
411 |
+
'default' => 3,
|
412 |
+
'placeholder' => '3',
|
413 |
+
);
|
414 |
+
|
415 |
+
$settings_tabs_field->generate_field($args);
|
416 |
+
|
417 |
+
$args = array(
|
418 |
+
'id' => 'separator',
|
419 |
+
'css_id' => $element_index.'_separator',
|
420 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
421 |
+
'title' => __('Link separator','post-grid'),
|
422 |
+
'details' => __('Choose link separator.','post-grid'),
|
423 |
+
'type' => 'text',
|
424 |
+
'value' => $separator,
|
425 |
+
'default' => '',
|
426 |
+
'placeholder' => ', ',
|
427 |
+
|
428 |
+
);
|
429 |
+
|
430 |
+
$settings_tabs_field->generate_field($args);
|
431 |
+
|
432 |
+
$args = array(
|
433 |
+
'id' => 'wrapper_html',
|
434 |
+
'css_id' => $element_index.'_wrapper_html',
|
435 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
436 |
+
'title' => __('Wrapper html','post-grid'),
|
437 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Categories: %s</code>','post-grid'),
|
438 |
+
'type' => 'text',
|
439 |
+
'value' => $wrapper_html,
|
440 |
+
'default' => '',
|
441 |
+
'placeholder' => 'Location: %s',
|
442 |
+
);
|
443 |
+
|
444 |
+
$settings_tabs_field->generate_field($args);
|
445 |
+
|
446 |
+
$args = array(
|
447 |
+
'id' => 'link_color',
|
448 |
+
'css_id' => $element_index.'_link_color',
|
449 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
450 |
+
'title' => __('Link color','post-grid'),
|
451 |
+
'details' => __('Choose link color.','post-grid'),
|
452 |
+
'type' => 'colorpicker',
|
453 |
+
'value' => $link_color,
|
454 |
+
'default' => '',
|
455 |
+
);
|
456 |
+
|
457 |
+
$settings_tabs_field->generate_field($args);
|
458 |
+
|
459 |
+
$args = array(
|
460 |
+
'id' => 'color',
|
461 |
+
'css_id' => $element_index.'_color',
|
462 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
463 |
+
'title' => __('Text Color','post-grid'),
|
464 |
+
'details' => __('Choose text color.','post-grid'),
|
465 |
+
'type' => 'colorpicker',
|
466 |
+
'value' => $color,
|
467 |
+
'default' => '',
|
468 |
+
);
|
469 |
+
|
470 |
+
$settings_tabs_field->generate_field($args);
|
471 |
+
|
472 |
+
$args = array(
|
473 |
+
'id' => 'font_size',
|
474 |
+
'css_id' => $element_index.'_font_size',
|
475 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
476 |
+
'title' => __('Font size','post-grid'),
|
477 |
+
'details' => __('Set font size.','post-grid'),
|
478 |
+
'type' => 'text',
|
479 |
+
'value' => $font_size,
|
480 |
+
'default' => '',
|
481 |
+
'placeholder' => '14px',
|
482 |
+
);
|
483 |
+
|
484 |
+
$settings_tabs_field->generate_field($args);
|
485 |
+
|
486 |
+
|
487 |
+
$args = array(
|
488 |
+
'id' => 'font_family',
|
489 |
+
'css_id' => $element_index.'_font_family',
|
490 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
491 |
+
'title' => __('Font family','post-grid'),
|
492 |
+
'details' => __('Set font family.','post-grid'),
|
493 |
+
'type' => 'text',
|
494 |
+
'value' => $font_family,
|
495 |
+
'default' => '',
|
496 |
+
'placeholder' => 'Open Sans',
|
497 |
+
);
|
498 |
+
|
499 |
+
$settings_tabs_field->generate_field($args);
|
500 |
+
|
501 |
+
|
502 |
+
$args = array(
|
503 |
+
'id' => 'margin',
|
504 |
+
'css_id' => $element_index.'_margin',
|
505 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
506 |
+
'title' => __('Margin','post-grid'),
|
507 |
+
'details' => __('Set margin.','post-grid'),
|
508 |
+
'type' => 'text',
|
509 |
+
'value' => $margin,
|
510 |
+
'default' => '',
|
511 |
+
'placeholder' => '5px 0',
|
512 |
+
);
|
513 |
+
|
514 |
+
$settings_tabs_field->generate_field($args);
|
515 |
+
|
516 |
+
|
517 |
+
$args = array(
|
518 |
+
'id' => 'text_align',
|
519 |
+
'css_id' => $element_index.'_text_align',
|
520 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
521 |
+
'title' => __('Text align','post-grid'),
|
522 |
+
'details' => __('Choose text align.','post-grid'),
|
523 |
+
'type' => 'select',
|
524 |
+
'value' => $text_align,
|
525 |
+
'default' => 'left',
|
526 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
527 |
+
);
|
528 |
+
|
529 |
+
$settings_tabs_field->generate_field($args);
|
530 |
+
|
531 |
+
|
532 |
+
$args = array(
|
533 |
+
'id' => 'css',
|
534 |
+
'css_id' => $element_index.'_css',
|
535 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
536 |
+
'title' => __('Custom CSS','post-grid'),
|
537 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
538 |
+
'type' => 'textarea',
|
539 |
+
'value' => $css,
|
540 |
+
'default' => '',
|
541 |
+
'placeholder' => '',
|
542 |
+
);
|
543 |
+
|
544 |
+
$settings_tabs_field->generate_field($args);
|
545 |
+
|
546 |
+
$args = array(
|
547 |
+
'id' => 'css_hover',
|
548 |
+
'css_id' => $element_index.'_css_hover',
|
549 |
+
'parent' => $input_name.'[simplejobboard_category]',
|
550 |
+
'title' => __('Hover CSS','post-grid'),
|
551 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
552 |
+
'type' => 'textarea',
|
553 |
+
'value' => $css_hover,
|
554 |
+
'default' => '',
|
555 |
+
'placeholder' => '',
|
556 |
+
);
|
557 |
+
|
558 |
+
$settings_tabs_field->generate_field($args);
|
559 |
+
|
560 |
+
|
561 |
+
ob_start();
|
562 |
+
?>
|
563 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
564 |
+
<?php
|
565 |
+
|
566 |
+
$html = ob_get_clean();
|
567 |
+
|
568 |
+
$args = array(
|
569 |
+
'id' => 'use_css',
|
570 |
+
'title' => __('Use of CSS','post-grid'),
|
571 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
572 |
+
'type' => 'custom_html',
|
573 |
+
'html' => $html,
|
574 |
+
|
575 |
+
);
|
576 |
+
|
577 |
+
$settings_tabs_field->generate_field($args);
|
578 |
+
|
579 |
+
?>
|
580 |
+
|
581 |
+
</div>
|
582 |
+
</div>
|
583 |
+
<?php
|
584 |
+
|
585 |
+
}
|
586 |
+
|
587 |
+
|
588 |
+
|
589 |
+
|
590 |
+
add_action('post_grid_layout_element_simplejobboard_category', 'post_grid_layout_element_simplejobboard_category');
|
591 |
+
|
592 |
+
function post_grid_layout_element_simplejobboard_category($args){
|
593 |
+
|
594 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
595 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
596 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
597 |
+
|
598 |
+
if(empty($post_id)) return;
|
599 |
+
|
600 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
601 |
+
$link_target = isset($element['link_target']) ? $element['link_target'] : '';
|
602 |
+
$max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
|
603 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
604 |
+
$separator = isset($element['separator']) ? $element['separator'] : ', ';
|
605 |
+
|
606 |
+
|
607 |
+
$term_list = wp_get_post_terms( $post_id, 'jobpost_category', array( 'fields' => 'all' ) );
|
608 |
+
|
609 |
+
$categories_html = '';
|
610 |
+
$term_total_count = count($term_list);
|
611 |
+
$max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
|
612 |
+
|
613 |
+
$i = 0;
|
614 |
+
foreach ($term_list as $term){
|
615 |
+
if($i >= $max_count) continue;
|
616 |
+
|
617 |
+
$term_id = isset($term->term_id) ? $term->term_id : '';
|
618 |
+
$term_name = isset($term->name) ? $term->name : '';
|
619 |
+
$term_link = get_term_link($term_id);
|
620 |
+
|
621 |
+
$categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
|
622 |
+
if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
|
623 |
+
|
624 |
+
$i++;
|
625 |
+
}
|
626 |
+
|
627 |
+
|
628 |
+
?>
|
629 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> categories ">
|
630 |
+
<?php echo sprintf($wrapper_html, $categories_html); ?>
|
631 |
+
</div>
|
632 |
+
<?php
|
633 |
+
}
|
634 |
+
|
635 |
+
|
636 |
+
|
637 |
+
|
638 |
+
|
639 |
+
add_action('post_grid_layout_element_css_simplejobboard_category', 'post_grid_layout_element_css_simplejobboard_category', 10);
|
640 |
+
function post_grid_layout_element_css_simplejobboard_category($args){
|
641 |
+
|
642 |
+
|
643 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
644 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
645 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
646 |
+
|
647 |
+
$link_color = isset($element['link_color']) ? $element['link_color'] : '';
|
648 |
+
$text_color = isset($element['text_color']) ? $element['text_color'] : '';
|
649 |
+
|
650 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
651 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
652 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
653 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : '';
|
654 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
655 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
656 |
+
?>
|
657 |
+
<style type="text/css">
|
658 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
659 |
+
<?php if(!empty($text_color)): ?>
|
660 |
+
color: <?php echo $text_color; ?>;
|
661 |
+
<?php endif; ?>
|
662 |
+
<?php if(!empty($font_size)): ?>
|
663 |
+
font-size: <?php echo $font_size; ?>;
|
664 |
+
<?php endif; ?>
|
665 |
+
<?php if(!empty($font_family)): ?>
|
666 |
+
font-family: <?php echo $font_family; ?>;
|
667 |
+
<?php endif; ?>
|
668 |
+
<?php if(!empty($margin)): ?>
|
669 |
+
margin: <?php echo $margin; ?>;
|
670 |
+
<?php endif; ?>
|
671 |
+
<?php if(!empty($text_align)): ?>
|
672 |
+
text-align: <?php echo $text_align; ?>;
|
673 |
+
<?php endif; ?>
|
674 |
+
<?php if(!empty($css)): ?>
|
675 |
+
<?php echo $css; ?>
|
676 |
+
<?php endif; ?>
|
677 |
+
}
|
678 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
|
679 |
+
<?php if(!empty($link_color)): ?>
|
680 |
+
color: <?php echo $link_color; ?>;
|
681 |
+
<?php endif; ?>
|
682 |
+
<?php if(!empty($font_size)): ?>
|
683 |
+
font-size: <?php echo $font_size; ?>;
|
684 |
+
<?php endif; ?>
|
685 |
+
<?php if(!empty($font_family)): ?>
|
686 |
+
font-family: <?php echo $font_family; ?>;
|
687 |
+
<?php endif; ?>
|
688 |
+
}
|
689 |
+
<?php if(!empty($css_hover)): ?>
|
690 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
691 |
+
<?php echo $css_hover; ?>
|
692 |
+
}
|
693 |
+
<?php endif; ?>
|
694 |
+
</style>
|
695 |
+
<?php
|
696 |
+
}
|
697 |
+
|
698 |
+
|
699 |
+
|
700 |
+
add_action('post_grid_layout_element_option_simplejobboard_job_type','post_grid_layout_element_option_simplejobboard_job_type');
|
701 |
+
function post_grid_layout_element_option_simplejobboard_job_type($parameters){
|
702 |
+
|
703 |
+
$settings_tabs_field = new settings_tabs_field();
|
704 |
+
|
705 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
706 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
707 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
708 |
+
|
709 |
+
|
710 |
+
$max_count = isset($element_data['max_count']) ? $element_data['max_count'] : '';
|
711 |
+
$separator = isset($element_data['separator']) ? $element_data['separator'] : '';
|
712 |
+
$link_color = isset($element_data['link_color']) ? $element_data['link_color'] : '';
|
713 |
+
|
714 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
715 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
716 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
717 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
718 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
719 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
720 |
+
|
721 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
722 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
723 |
+
|
724 |
+
|
725 |
+
|
726 |
+
?>
|
727 |
+
<div class="item">
|
728 |
+
<div class="element-title header ">
|
729 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
730 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
731 |
+
|
732 |
+
<span class="expand"><?php echo __('Job type','post-grid'); ?></span>
|
733 |
+
</div>
|
734 |
+
<div class="element-options options">
|
735 |
+
|
736 |
+
<?php
|
737 |
+
|
738 |
+
$args = array(
|
739 |
+
'id' => 'max_count',
|
740 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
741 |
+
'title' => __('Max count','post-grid'),
|
742 |
+
'details' => __('Write max count','post-grid'),
|
743 |
+
'type' => 'text',
|
744 |
+
'value' => $max_count,
|
745 |
+
'default' => 3,
|
746 |
+
'placeholder' => '3',
|
747 |
+
);
|
748 |
+
|
749 |
+
$settings_tabs_field->generate_field($args);
|
750 |
+
|
751 |
+
$args = array(
|
752 |
+
'id' => 'separator',
|
753 |
+
'css_id' => $element_index.'_separator',
|
754 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
755 |
+
'title' => __('Link separator','post-grid'),
|
756 |
+
'details' => __('Choose link separator.','post-grid'),
|
757 |
+
'type' => 'text',
|
758 |
+
'value' => $separator,
|
759 |
+
'default' => '',
|
760 |
+
'placeholder' => ', ',
|
761 |
+
|
762 |
+
);
|
763 |
+
|
764 |
+
$settings_tabs_field->generate_field($args);
|
765 |
+
|
766 |
+
$args = array(
|
767 |
+
'id' => 'wrapper_html',
|
768 |
+
'css_id' => $element_index.'_wrapper_html',
|
769 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
770 |
+
'title' => __('Wrapper html','post-grid'),
|
771 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Job type: %s</code>','post-grid'),
|
772 |
+
'type' => 'text',
|
773 |
+
'value' => $wrapper_html,
|
774 |
+
'default' => '',
|
775 |
+
'placeholder' => 'Job type: %s',
|
776 |
+
);
|
777 |
+
|
778 |
+
$settings_tabs_field->generate_field($args);
|
779 |
+
|
780 |
+
$args = array(
|
781 |
+
'id' => 'link_color',
|
782 |
+
'css_id' => $element_index.'_link_color',
|
783 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
784 |
+
'title' => __('Link color','post-grid'),
|
785 |
+
'details' => __('Choose link color.','post-grid'),
|
786 |
+
'type' => 'colorpicker',
|
787 |
+
'value' => $link_color,
|
788 |
+
'default' => '',
|
789 |
+
);
|
790 |
+
|
791 |
+
$settings_tabs_field->generate_field($args);
|
792 |
+
|
793 |
+
$args = array(
|
794 |
+
'id' => 'color',
|
795 |
+
'css_id' => $element_index.'_color',
|
796 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
797 |
+
'title' => __('Text Color','post-grid'),
|
798 |
+
'details' => __('Choose text color.','post-grid'),
|
799 |
+
'type' => 'colorpicker',
|
800 |
+
'value' => $color,
|
801 |
+
'default' => '',
|
802 |
+
);
|
803 |
+
|
804 |
+
$settings_tabs_field->generate_field($args);
|
805 |
+
|
806 |
+
$args = array(
|
807 |
+
'id' => 'font_size',
|
808 |
+
'css_id' => $element_index.'_font_size',
|
809 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
810 |
+
'title' => __('Font size','post-grid'),
|
811 |
+
'details' => __('Set font size.','post-grid'),
|
812 |
+
'type' => 'text',
|
813 |
+
'value' => $font_size,
|
814 |
+
'default' => '',
|
815 |
+
'placeholder' => '14px',
|
816 |
+
);
|
817 |
+
|
818 |
+
$settings_tabs_field->generate_field($args);
|
819 |
+
|
820 |
+
|
821 |
+
$args = array(
|
822 |
+
'id' => 'font_family',
|
823 |
+
'css_id' => $element_index.'_font_family',
|
824 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
825 |
+
'title' => __('Font family','post-grid'),
|
826 |
+
'details' => __('Set font family.','post-grid'),
|
827 |
+
'type' => 'text',
|
828 |
+
'value' => $font_family,
|
829 |
+
'default' => '',
|
830 |
+
'placeholder' => 'Open Sans',
|
831 |
+
);
|
832 |
+
|
833 |
+
$settings_tabs_field->generate_field($args);
|
834 |
+
|
835 |
+
|
836 |
+
$args = array(
|
837 |
+
'id' => 'margin',
|
838 |
+
'css_id' => $element_index.'_margin',
|
839 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
840 |
+
'title' => __('Margin','post-grid'),
|
841 |
+
'details' => __('Set margin.','post-grid'),
|
842 |
+
'type' => 'text',
|
843 |
+
'value' => $margin,
|
844 |
+
'default' => '',
|
845 |
+
'placeholder' => '5px 0',
|
846 |
+
);
|
847 |
+
|
848 |
+
$settings_tabs_field->generate_field($args);
|
849 |
+
|
850 |
+
|
851 |
+
$args = array(
|
852 |
+
'id' => 'text_align',
|
853 |
+
'css_id' => $element_index.'_text_align',
|
854 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
855 |
+
'title' => __('Text align','post-grid'),
|
856 |
+
'details' => __('Choose text align.','post-grid'),
|
857 |
+
'type' => 'select',
|
858 |
+
'value' => $text_align,
|
859 |
+
'default' => 'left',
|
860 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
861 |
+
);
|
862 |
+
|
863 |
+
$settings_tabs_field->generate_field($args);
|
864 |
+
|
865 |
+
|
866 |
+
$args = array(
|
867 |
+
'id' => 'css',
|
868 |
+
'css_id' => $element_index.'_css',
|
869 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
870 |
+
'title' => __('Custom CSS','post-grid'),
|
871 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
872 |
+
'type' => 'textarea',
|
873 |
+
'value' => $css,
|
874 |
+
'default' => '',
|
875 |
+
'placeholder' => '',
|
876 |
+
);
|
877 |
+
|
878 |
+
$settings_tabs_field->generate_field($args);
|
879 |
+
|
880 |
+
$args = array(
|
881 |
+
'id' => 'css_hover',
|
882 |
+
'css_id' => $element_index.'_css_hover',
|
883 |
+
'parent' => $input_name.'[simplejobboard_job_type]',
|
884 |
+
'title' => __('Hover CSS','post-grid'),
|
885 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
886 |
+
'type' => 'textarea',
|
887 |
+
'value' => $css_hover,
|
888 |
+
'default' => '',
|
889 |
+
'placeholder' => '',
|
890 |
+
);
|
891 |
+
|
892 |
+
$settings_tabs_field->generate_field($args);
|
893 |
+
|
894 |
+
|
895 |
+
ob_start();
|
896 |
+
?>
|
897 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
898 |
+
<?php
|
899 |
+
|
900 |
+
$html = ob_get_clean();
|
901 |
+
|
902 |
+
$args = array(
|
903 |
+
'id' => 'use_css',
|
904 |
+
'title' => __('Use of CSS','post-grid'),
|
905 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
906 |
+
'type' => 'custom_html',
|
907 |
+
'html' => $html,
|
908 |
+
|
909 |
+
);
|
910 |
+
|
911 |
+
$settings_tabs_field->generate_field($args);
|
912 |
+
|
913 |
+
?>
|
914 |
+
|
915 |
+
</div>
|
916 |
+
</div>
|
917 |
+
<?php
|
918 |
+
|
919 |
+
}
|
920 |
+
|
921 |
+
|
922 |
+
|
923 |
+
|
924 |
+
add_action('post_grid_layout_element_simplejobboard_job_type', 'post_grid_layout_element_simplejobboard_job_type');
|
925 |
+
|
926 |
+
function post_grid_layout_element_simplejobboard_job_type($args){
|
927 |
+
|
928 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
929 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
930 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
931 |
+
|
932 |
+
if(empty($post_id)) return;
|
933 |
+
|
934 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
935 |
+
$link_target = isset($element['link_target']) ? $element['link_target'] : '';
|
936 |
+
$max_count = isset($element['max_count']) ? (int) $element['max_count'] : 3;
|
937 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
938 |
+
$separator = isset($element['separator']) ? $element['separator'] : ', ';
|
939 |
+
|
940 |
+
|
941 |
+
$term_list = wp_get_post_terms( $post_id, 'jobpost_job_type', array( 'fields' => 'all' ) );
|
942 |
+
|
943 |
+
$categories_html = '';
|
944 |
+
$term_total_count = count($term_list);
|
945 |
+
$max_term_limit = ($term_total_count < $max_count) ? $term_total_count : $max_count ;
|
946 |
+
|
947 |
+
$i = 0;
|
948 |
+
foreach ($term_list as $term){
|
949 |
+
if($i >= $max_count) continue;
|
950 |
+
|
951 |
+
$term_id = isset($term->term_id) ? $term->term_id : '';
|
952 |
+
$term_name = isset($term->name) ? $term->name : '';
|
953 |
+
$term_link = get_term_link($term_id);
|
954 |
+
|
955 |
+
$categories_html .= '<a target="'.esc_attr($link_target).'" href="'.esc_url_raw($term_link).'">'.esc_html($term_name).'</a>';
|
956 |
+
if( $i+1 < $max_term_limit){ $categories_html .= $separator;}
|
957 |
+
|
958 |
+
$i++;
|
959 |
+
}
|
960 |
+
|
961 |
+
|
962 |
+
?>
|
963 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> categories ">
|
964 |
+
<?php echo sprintf($wrapper_html, $categories_html); ?>
|
965 |
+
</div>
|
966 |
+
<?php
|
967 |
+
}
|
968 |
+
|
969 |
+
|
970 |
+
|
971 |
+
|
972 |
+
|
973 |
+
add_action('post_grid_layout_element_css_simplejobboard_job_type', 'post_grid_layout_element_css_simplejobboard_job_type', 10);
|
974 |
+
function post_grid_layout_element_css_simplejobboard_job_type($args){
|
975 |
+
|
976 |
+
|
977 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
978 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
979 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
980 |
+
|
981 |
+
$link_color = isset($element['link_color']) ? $element['link_color'] : '';
|
982 |
+
$text_color = isset($element['text_color']) ? $element['text_color'] : '';
|
983 |
+
|
984 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
985 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
986 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
987 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : '';
|
988 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
989 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
990 |
+
?>
|
991 |
+
<style type="text/css">
|
992 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
993 |
+
<?php if(!empty($text_color)): ?>
|
994 |
+
color: <?php echo $text_color; ?>;
|
995 |
+
<?php endif; ?>
|
996 |
+
<?php if(!empty($font_size)): ?>
|
997 |
+
font-size: <?php echo $font_size; ?>;
|
998 |
+
<?php endif; ?>
|
999 |
+
<?php if(!empty($font_family)): ?>
|
1000 |
+
font-family: <?php echo $font_family; ?>;
|
1001 |
+
<?php endif; ?>
|
1002 |
+
<?php if(!empty($margin)): ?>
|
1003 |
+
margin: <?php echo $margin; ?>;
|
1004 |
+
<?php endif; ?>
|
1005 |
+
<?php if(!empty($text_align)): ?>
|
1006 |
+
text-align: <?php echo $text_align; ?>;
|
1007 |
+
<?php endif; ?>
|
1008 |
+
<?php if(!empty($css)): ?>
|
1009 |
+
<?php echo $css; ?>
|
1010 |
+
<?php endif; ?>
|
1011 |
+
}
|
1012 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?> a{
|
1013 |
+
<?php if(!empty($link_color)): ?>
|
1014 |
+
color: <?php echo $link_color; ?>;
|
1015 |
+
<?php endif; ?>
|
1016 |
+
<?php if(!empty($font_size)): ?>
|
1017 |
+
font-size: <?php echo $font_size; ?>;
|
1018 |
+
<?php endif; ?>
|
1019 |
+
<?php if(!empty($font_family)): ?>
|
1020 |
+
font-family: <?php echo $font_family; ?>;
|
1021 |
+
<?php endif; ?>
|
1022 |
+
}
|
1023 |
+
<?php if(!empty($css_hover)): ?>
|
1024 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1025 |
+
<?php echo $css_hover; ?>
|
1026 |
+
}
|
1027 |
+
<?php endif; ?>
|
1028 |
+
</style>
|
1029 |
+
<?php
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
|
1033 |
+
|
1034 |
+
add_action('post_grid_layout_element_option_simplejobboard_company_name','post_grid_layout_element_option_simplejobboard_company_name');
|
1035 |
+
function post_grid_layout_element_option_simplejobboard_company_name($parameters){
|
1036 |
+
|
1037 |
+
$settings_tabs_field = new settings_tabs_field();
|
1038 |
+
|
1039 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1040 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1041 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1042 |
+
|
1043 |
+
|
1044 |
+
|
1045 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1046 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1047 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1048 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1049 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1050 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1051 |
+
|
1052 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1053 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1054 |
+
|
1055 |
+
|
1056 |
+
|
1057 |
+
?>
|
1058 |
+
<div class="item">
|
1059 |
+
<div class="element-title header ">
|
1060 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1061 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1062 |
+
|
1063 |
+
<span class="expand"><?php echo __('Company Name','post-grid'); ?></span>
|
1064 |
+
</div>
|
1065 |
+
<div class="element-options options">
|
1066 |
+
|
1067 |
+
<?php
|
1068 |
+
|
1069 |
+
|
1070 |
+
$args = array(
|
1071 |
+
'id' => 'wrapper_html',
|
1072 |
+
'css_id' => $element_index.'_wrapper_html',
|
1073 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1074 |
+
'title' => __('Wrapper html','post-grid'),
|
1075 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Company name: %s</code>','post-grid'),
|
1076 |
+
'type' => 'text',
|
1077 |
+
'value' => $wrapper_html,
|
1078 |
+
'default' => '',
|
1079 |
+
'placeholder' => 'Company name: %s',
|
1080 |
+
);
|
1081 |
+
|
1082 |
+
$settings_tabs_field->generate_field($args);
|
1083 |
+
|
1084 |
+
$args = array(
|
1085 |
+
'id' => 'color',
|
1086 |
+
'css_id' => $element_index.'_simplejobboard_company_name',
|
1087 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1088 |
+
'title' => __('Color','post-grid'),
|
1089 |
+
'details' => __('Title text color.','post-grid'),
|
1090 |
+
'type' => 'colorpicker',
|
1091 |
+
'value' => $color,
|
1092 |
+
'default' => '',
|
1093 |
+
);
|
1094 |
+
|
1095 |
+
$settings_tabs_field->generate_field($args);
|
1096 |
+
|
1097 |
+
$args = array(
|
1098 |
+
'id' => 'font_size',
|
1099 |
+
'css_id' => $element_index.'_font_size',
|
1100 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1101 |
+
'title' => __('Font size','post-grid'),
|
1102 |
+
'details' => __('Set font size.','post-grid'),
|
1103 |
+
'type' => 'text',
|
1104 |
+
'value' => $font_size,
|
1105 |
+
'default' => '',
|
1106 |
+
'placeholder' => '14px',
|
1107 |
+
);
|
1108 |
+
|
1109 |
+
$settings_tabs_field->generate_field($args);
|
1110 |
+
|
1111 |
+
|
1112 |
+
$args = array(
|
1113 |
+
'id' => 'font_family',
|
1114 |
+
'css_id' => $element_index.'_font_family',
|
1115 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1116 |
+
'title' => __('Font family','post-grid'),
|
1117 |
+
'details' => __('Set font family.','post-grid'),
|
1118 |
+
'type' => 'text',
|
1119 |
+
'value' => $font_family,
|
1120 |
+
'default' => '',
|
1121 |
+
'placeholder' => 'Open Sans',
|
1122 |
+
);
|
1123 |
+
|
1124 |
+
$settings_tabs_field->generate_field($args);
|
1125 |
+
|
1126 |
+
|
1127 |
+
$args = array(
|
1128 |
+
'id' => 'margin',
|
1129 |
+
'css_id' => $element_index.'_margin',
|
1130 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1131 |
+
'title' => __('Margin','post-grid'),
|
1132 |
+
'details' => __('Set margin.','post-grid'),
|
1133 |
+
'type' => 'text',
|
1134 |
+
'value' => $margin,
|
1135 |
+
'default' => '',
|
1136 |
+
'placeholder' => '5px 0',
|
1137 |
+
);
|
1138 |
+
|
1139 |
+
$settings_tabs_field->generate_field($args);
|
1140 |
+
|
1141 |
+
|
1142 |
+
$args = array(
|
1143 |
+
'id' => 'text_align',
|
1144 |
+
'css_id' => $element_index.'_text_align',
|
1145 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1146 |
+
'title' => __('Text align','post-grid'),
|
1147 |
+
'details' => __('Choose text align.','post-grid'),
|
1148 |
+
'type' => 'select',
|
1149 |
+
'value' => $text_align,
|
1150 |
+
'default' => 'left',
|
1151 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1152 |
+
);
|
1153 |
+
|
1154 |
+
$settings_tabs_field->generate_field($args);
|
1155 |
+
|
1156 |
+
|
1157 |
+
$args = array(
|
1158 |
+
'id' => 'css',
|
1159 |
+
'css_id' => $element_index.'_css',
|
1160 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1161 |
+
'title' => __('Custom CSS','post-grid'),
|
1162 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1163 |
+
'type' => 'textarea',
|
1164 |
+
'value' => $css,
|
1165 |
+
'default' => '',
|
1166 |
+
'placeholder' => '',
|
1167 |
+
);
|
1168 |
+
|
1169 |
+
$settings_tabs_field->generate_field($args);
|
1170 |
+
|
1171 |
+
$args = array(
|
1172 |
+
'id' => 'css_hover',
|
1173 |
+
'css_id' => $element_index.'_css_hover',
|
1174 |
+
'parent' => $input_name.'[simplejobboard_company_name]',
|
1175 |
+
'title' => __('Hover CSS','post-grid'),
|
1176 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1177 |
+
'type' => 'textarea',
|
1178 |
+
'value' => $css_hover,
|
1179 |
+
'default' => '',
|
1180 |
+
'placeholder' => '',
|
1181 |
+
);
|
1182 |
+
|
1183 |
+
$settings_tabs_field->generate_field($args);
|
1184 |
+
|
1185 |
+
|
1186 |
+
ob_start();
|
1187 |
+
?>
|
1188 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1189 |
+
<?php
|
1190 |
+
|
1191 |
+
$html = ob_get_clean();
|
1192 |
+
|
1193 |
+
$args = array(
|
1194 |
+
'id' => 'use_css',
|
1195 |
+
'title' => __('Use of CSS','post-grid'),
|
1196 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1197 |
+
'type' => 'custom_html',
|
1198 |
+
'html' => $html,
|
1199 |
+
|
1200 |
+
);
|
1201 |
+
|
1202 |
+
$settings_tabs_field->generate_field($args);
|
1203 |
+
|
1204 |
+
?>
|
1205 |
+
|
1206 |
+
</div>
|
1207 |
+
</div>
|
1208 |
+
<?php
|
1209 |
+
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
|
1213 |
+
|
1214 |
+
add_action('post_grid_layout_element_simplejobboard_company_name', 'post_grid_layout_element_simplejobboard_company_name');
|
1215 |
+
function post_grid_layout_element_simplejobboard_company_name($args){
|
1216 |
+
|
1217 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1218 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1219 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1220 |
+
|
1221 |
+
if(empty($post_id)) return;
|
1222 |
+
|
1223 |
+
|
1224 |
+
|
1225 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1226 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1227 |
+
|
1228 |
+
|
1229 |
+
|
1230 |
+
|
1231 |
+
$meta_value = get_post_meta($post_id, 'simple_job_board_company_name', true );
|
1232 |
+
|
1233 |
+
if(!empty($meta_value)):
|
1234 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
1235 |
+
|
1236 |
+
?>
|
1237 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_company_name ">
|
1238 |
+
<?php echo ($meta_value); ?>
|
1239 |
+
</div>
|
1240 |
+
<?php
|
1241 |
+
endif;
|
1242 |
+
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
|
1246 |
+
|
1247 |
+
add_action('post_grid_layout_element_css_simplejobboard_company_name', 'post_grid_layout_element_css_simplejobboard_company_name', 10);
|
1248 |
+
function post_grid_layout_element_css_simplejobboard_company_name($args){
|
1249 |
+
|
1250 |
+
|
1251 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1252 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1253 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1254 |
+
|
1255 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1256 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1257 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1258 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1259 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1260 |
+
|
1261 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1262 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1263 |
+
|
1264 |
+
?>
|
1265 |
+
<style type="text/css">
|
1266 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1267 |
+
<?php if(!empty($color)): ?>
|
1268 |
+
color: <?php echo $color; ?>;
|
1269 |
+
<?php endif; ?>
|
1270 |
+
<?php if(!empty($font_size)): ?>
|
1271 |
+
font-size: <?php echo $font_size; ?>;
|
1272 |
+
<?php endif; ?>
|
1273 |
+
<?php if(!empty($font_family)): ?>
|
1274 |
+
font-family: <?php echo $font_family; ?>;
|
1275 |
+
<?php endif; ?>
|
1276 |
+
<?php if(!empty($margin)): ?>
|
1277 |
+
margin: <?php echo $margin; ?>;
|
1278 |
+
<?php endif; ?>
|
1279 |
+
<?php if(!empty($text_align)): ?>
|
1280 |
+
text-align: <?php echo $text_align; ?>;
|
1281 |
+
<?php endif; ?>
|
1282 |
+
<?php if(!empty($css)): ?>
|
1283 |
+
<?php echo $css; ?>
|
1284 |
+
<?php endif; ?>
|
1285 |
+
}
|
1286 |
+
<?php if(!empty($css_hover)): ?>
|
1287 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1288 |
+
<?php echo $css_hover; ?>
|
1289 |
+
}
|
1290 |
+
<?php endif; ?>
|
1291 |
+
</style>
|
1292 |
+
<?php
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
add_action('post_grid_layout_element_option_simplejobboard_company_website','post_grid_layout_element_option_simplejobboard_company_website');
|
1296 |
+
function post_grid_layout_element_option_simplejobboard_company_website($parameters){
|
1297 |
+
|
1298 |
+
$settings_tabs_field = new settings_tabs_field();
|
1299 |
+
|
1300 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1301 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1302 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1303 |
+
|
1304 |
+
|
1305 |
+
|
1306 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1307 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1308 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1309 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1310 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1311 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1312 |
+
|
1313 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1314 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1315 |
+
|
1316 |
+
|
1317 |
+
|
1318 |
+
?>
|
1319 |
+
<div class="item">
|
1320 |
+
<div class="element-title header ">
|
1321 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1322 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1323 |
+
|
1324 |
+
<span class="expand"><?php echo __('Company website','post-grid'); ?></span>
|
1325 |
+
</div>
|
1326 |
+
<div class="element-options options">
|
1327 |
+
|
1328 |
+
<?php
|
1329 |
+
|
1330 |
+
|
1331 |
+
$args = array(
|
1332 |
+
'id' => 'wrapper_html',
|
1333 |
+
'css_id' => $element_index.'_wrapper_html',
|
1334 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1335 |
+
'title' => __('Wrapper html','post-grid'),
|
1336 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Website: <a href="%s">Go link</a></code> <code>Website: <a href="%1$s">%2$s</a></code>','post-grid'),
|
1337 |
+
'type' => 'text',
|
1338 |
+
'value' => $wrapper_html,
|
1339 |
+
'default' => '',
|
1340 |
+
'placeholder' => 'Website: %s',
|
1341 |
+
);
|
1342 |
+
|
1343 |
+
$settings_tabs_field->generate_field($args);
|
1344 |
+
|
1345 |
+
$args = array(
|
1346 |
+
'id' => 'color',
|
1347 |
+
'css_id' => $element_index.'_simplejobboard_company_website',
|
1348 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1349 |
+
'title' => __('Color','post-grid'),
|
1350 |
+
'details' => __('Title text color.','post-grid'),
|
1351 |
+
'type' => 'colorpicker',
|
1352 |
+
'value' => $color,
|
1353 |
+
'default' => '',
|
1354 |
+
);
|
1355 |
+
|
1356 |
+
$settings_tabs_field->generate_field($args);
|
1357 |
+
|
1358 |
+
$args = array(
|
1359 |
+
'id' => 'font_size',
|
1360 |
+
'css_id' => $element_index.'_font_size',
|
1361 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1362 |
+
'title' => __('Font size','post-grid'),
|
1363 |
+
'details' => __('Set font size.','post-grid'),
|
1364 |
+
'type' => 'text',
|
1365 |
+
'value' => $font_size,
|
1366 |
+
'default' => '',
|
1367 |
+
'placeholder' => '14px',
|
1368 |
+
);
|
1369 |
+
|
1370 |
+
$settings_tabs_field->generate_field($args);
|
1371 |
+
|
1372 |
+
|
1373 |
+
$args = array(
|
1374 |
+
'id' => 'font_family',
|
1375 |
+
'css_id' => $element_index.'_font_family',
|
1376 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1377 |
+
'title' => __('Font family','post-grid'),
|
1378 |
+
'details' => __('Set font family.','post-grid'),
|
1379 |
+
'type' => 'text',
|
1380 |
+
'value' => $font_family,
|
1381 |
+
'default' => '',
|
1382 |
+
'placeholder' => 'Open Sans',
|
1383 |
+
);
|
1384 |
+
|
1385 |
+
$settings_tabs_field->generate_field($args);
|
1386 |
+
|
1387 |
+
|
1388 |
+
$args = array(
|
1389 |
+
'id' => 'margin',
|
1390 |
+
'css_id' => $element_index.'_margin',
|
1391 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1392 |
+
'title' => __('Margin','post-grid'),
|
1393 |
+
'details' => __('Set margin.','post-grid'),
|
1394 |
+
'type' => 'text',
|
1395 |
+
'value' => $margin,
|
1396 |
+
'default' => '',
|
1397 |
+
'placeholder' => '5px 0',
|
1398 |
+
);
|
1399 |
+
|
1400 |
+
$settings_tabs_field->generate_field($args);
|
1401 |
+
|
1402 |
+
|
1403 |
+
$args = array(
|
1404 |
+
'id' => 'text_align',
|
1405 |
+
'css_id' => $element_index.'_text_align',
|
1406 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1407 |
+
'title' => __('Text align','post-grid'),
|
1408 |
+
'details' => __('Choose text align.','post-grid'),
|
1409 |
+
'type' => 'select',
|
1410 |
+
'value' => $text_align,
|
1411 |
+
'default' => 'left',
|
1412 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1413 |
+
);
|
1414 |
+
|
1415 |
+
$settings_tabs_field->generate_field($args);
|
1416 |
+
|
1417 |
+
|
1418 |
+
$args = array(
|
1419 |
+
'id' => 'css',
|
1420 |
+
'css_id' => $element_index.'_css',
|
1421 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1422 |
+
'title' => __('Custom CSS','post-grid'),
|
1423 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1424 |
+
'type' => 'textarea',
|
1425 |
+
'value' => $css,
|
1426 |
+
'default' => '',
|
1427 |
+
'placeholder' => '',
|
1428 |
+
);
|
1429 |
+
|
1430 |
+
$settings_tabs_field->generate_field($args);
|
1431 |
+
|
1432 |
+
$args = array(
|
1433 |
+
'id' => 'css_hover',
|
1434 |
+
'css_id' => $element_index.'_css_hover',
|
1435 |
+
'parent' => $input_name.'[simplejobboard_company_website]',
|
1436 |
+
'title' => __('Hover CSS','post-grid'),
|
1437 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1438 |
+
'type' => 'textarea',
|
1439 |
+
'value' => $css_hover,
|
1440 |
+
'default' => '',
|
1441 |
+
'placeholder' => '',
|
1442 |
+
);
|
1443 |
+
|
1444 |
+
$settings_tabs_field->generate_field($args);
|
1445 |
+
|
1446 |
+
|
1447 |
+
ob_start();
|
1448 |
+
?>
|
1449 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1450 |
+
<?php
|
1451 |
+
|
1452 |
+
$html = ob_get_clean();
|
1453 |
+
|
1454 |
+
$args = array(
|
1455 |
+
'id' => 'use_css',
|
1456 |
+
'title' => __('Use of CSS','post-grid'),
|
1457 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1458 |
+
'type' => 'custom_html',
|
1459 |
+
'html' => $html,
|
1460 |
+
|
1461 |
+
);
|
1462 |
+
|
1463 |
+
$settings_tabs_field->generate_field($args);
|
1464 |
+
|
1465 |
+
?>
|
1466 |
+
|
1467 |
+
</div>
|
1468 |
+
</div>
|
1469 |
+
<?php
|
1470 |
+
|
1471 |
+
}
|
1472 |
+
|
1473 |
+
|
1474 |
+
|
1475 |
+
add_action('post_grid_layout_element_simplejobboard_company_website', 'post_grid_layout_element_simplejobboard_company_website');
|
1476 |
+
function post_grid_layout_element_simplejobboard_company_website($args){
|
1477 |
+
|
1478 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1479 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1480 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1481 |
+
|
1482 |
+
if(empty($post_id)) return;
|
1483 |
+
|
1484 |
+
|
1485 |
+
|
1486 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1487 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1488 |
+
|
1489 |
+
|
1490 |
+
|
1491 |
+
|
1492 |
+
$meta_value = get_post_meta($post_id, 'simple_job_board_company_website', true );
|
1493 |
+
|
1494 |
+
if(!empty($meta_value)):
|
1495 |
+
$meta_value = sprintf($wrapper_html, $meta_value, $meta_value);
|
1496 |
+
|
1497 |
+
?>
|
1498 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_company_website ">
|
1499 |
+
<?php echo ($meta_value); ?>
|
1500 |
+
</div>
|
1501 |
+
<?php
|
1502 |
+
endif;
|
1503 |
+
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
|
1507 |
+
|
1508 |
+
add_action('post_grid_layout_element_css_simplejobboard_company_website', 'post_grid_layout_element_css_simplejobboard_company_website', 10);
|
1509 |
+
function post_grid_layout_element_css_simplejobboard_company_website($args){
|
1510 |
+
|
1511 |
+
|
1512 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1513 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1514 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1515 |
+
|
1516 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1517 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1518 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1519 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1520 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1521 |
+
|
1522 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1523 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1524 |
+
|
1525 |
+
?>
|
1526 |
+
<style type="text/css">
|
1527 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1528 |
+
<?php if(!empty($color)): ?>
|
1529 |
+
color: <?php echo $color; ?>;
|
1530 |
+
<?php endif; ?>
|
1531 |
+
<?php if(!empty($font_size)): ?>
|
1532 |
+
font-size: <?php echo $font_size; ?>;
|
1533 |
+
<?php endif; ?>
|
1534 |
+
<?php if(!empty($font_family)): ?>
|
1535 |
+
font-family: <?php echo $font_family; ?>;
|
1536 |
+
<?php endif; ?>
|
1537 |
+
<?php if(!empty($margin)): ?>
|
1538 |
+
margin: <?php echo $margin; ?>;
|
1539 |
+
<?php endif; ?>
|
1540 |
+
<?php if(!empty($text_align)): ?>
|
1541 |
+
text-align: <?php echo $text_align; ?>;
|
1542 |
+
<?php endif; ?>
|
1543 |
+
<?php if(!empty($css)): ?>
|
1544 |
+
<?php echo $css; ?>
|
1545 |
+
<?php endif; ?>
|
1546 |
+
}
|
1547 |
+
<?php if(!empty($css_hover)): ?>
|
1548 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1549 |
+
<?php echo $css_hover; ?>
|
1550 |
+
}
|
1551 |
+
<?php endif; ?>
|
1552 |
+
</style>
|
1553 |
+
<?php
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
|
1557 |
+
add_action('post_grid_layout_element_option_simplejobboard_company_tagline','post_grid_layout_element_option_simplejobboard_company_tagline');
|
1558 |
+
function post_grid_layout_element_option_simplejobboard_company_tagline($parameters){
|
1559 |
+
|
1560 |
+
$settings_tabs_field = new settings_tabs_field();
|
1561 |
+
|
1562 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1563 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1564 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1565 |
+
|
1566 |
+
|
1567 |
+
|
1568 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1569 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1570 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1571 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1572 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1573 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1574 |
+
|
1575 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1576 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1577 |
+
|
1578 |
+
|
1579 |
+
|
1580 |
+
?>
|
1581 |
+
<div class="item">
|
1582 |
+
<div class="element-title header ">
|
1583 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1584 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1585 |
+
|
1586 |
+
<span class="expand"><?php echo __('Company tagline','post-grid'); ?></span>
|
1587 |
+
</div>
|
1588 |
+
<div class="element-options options">
|
1589 |
+
|
1590 |
+
<?php
|
1591 |
+
|
1592 |
+
|
1593 |
+
$args = array(
|
1594 |
+
'id' => 'wrapper_html',
|
1595 |
+
'css_id' => $element_index.'_wrapper_html',
|
1596 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1597 |
+
'title' => __('Wrapper html','post-grid'),
|
1598 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output, <code>Tagline: %s</code>','post-grid'),
|
1599 |
+
'type' => 'text',
|
1600 |
+
'value' => $wrapper_html,
|
1601 |
+
'default' => '',
|
1602 |
+
'placeholder' => 'Tagline: %s',
|
1603 |
+
);
|
1604 |
+
|
1605 |
+
$settings_tabs_field->generate_field($args);
|
1606 |
+
|
1607 |
+
$args = array(
|
1608 |
+
'id' => 'color',
|
1609 |
+
'css_id' => $element_index.'_simplejobboard_company_tagline',
|
1610 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1611 |
+
'title' => __('Color','post-grid'),
|
1612 |
+
'details' => __('Title text color.','post-grid'),
|
1613 |
+
'type' => 'colorpicker',
|
1614 |
+
'value' => $color,
|
1615 |
+
'default' => '',
|
1616 |
+
);
|
1617 |
+
|
1618 |
+
$settings_tabs_field->generate_field($args);
|
1619 |
+
|
1620 |
+
$args = array(
|
1621 |
+
'id' => 'font_size',
|
1622 |
+
'css_id' => $element_index.'_font_size',
|
1623 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1624 |
+
'title' => __('Font size','post-grid'),
|
1625 |
+
'details' => __('Set font size.','post-grid'),
|
1626 |
+
'type' => 'text',
|
1627 |
+
'value' => $font_size,
|
1628 |
+
'default' => '',
|
1629 |
+
'placeholder' => '14px',
|
1630 |
+
);
|
1631 |
+
|
1632 |
+
$settings_tabs_field->generate_field($args);
|
1633 |
+
|
1634 |
+
|
1635 |
+
$args = array(
|
1636 |
+
'id' => 'font_family',
|
1637 |
+
'css_id' => $element_index.'_font_family',
|
1638 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1639 |
+
'title' => __('Font family','post-grid'),
|
1640 |
+
'details' => __('Set font family.','post-grid'),
|
1641 |
+
'type' => 'text',
|
1642 |
+
'value' => $font_family,
|
1643 |
+
'default' => '',
|
1644 |
+
'placeholder' => 'Open Sans',
|
1645 |
+
);
|
1646 |
+
|
1647 |
+
$settings_tabs_field->generate_field($args);
|
1648 |
+
|
1649 |
+
|
1650 |
+
$args = array(
|
1651 |
+
'id' => 'margin',
|
1652 |
+
'css_id' => $element_index.'_margin',
|
1653 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1654 |
+
'title' => __('Margin','post-grid'),
|
1655 |
+
'details' => __('Set margin.','post-grid'),
|
1656 |
+
'type' => 'text',
|
1657 |
+
'value' => $margin,
|
1658 |
+
'default' => '',
|
1659 |
+
'placeholder' => '5px 0',
|
1660 |
+
);
|
1661 |
+
|
1662 |
+
$settings_tabs_field->generate_field($args);
|
1663 |
+
|
1664 |
+
|
1665 |
+
$args = array(
|
1666 |
+
'id' => 'text_align',
|
1667 |
+
'css_id' => $element_index.'_text_align',
|
1668 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1669 |
+
'title' => __('Text align','post-grid'),
|
1670 |
+
'details' => __('Choose text align.','post-grid'),
|
1671 |
+
'type' => 'select',
|
1672 |
+
'value' => $text_align,
|
1673 |
+
'default' => 'left',
|
1674 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1675 |
+
);
|
1676 |
+
|
1677 |
+
$settings_tabs_field->generate_field($args);
|
1678 |
+
|
1679 |
+
|
1680 |
+
$args = array(
|
1681 |
+
'id' => 'css',
|
1682 |
+
'css_id' => $element_index.'_css',
|
1683 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1684 |
+
'title' => __('Custom CSS','post-grid'),
|
1685 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1686 |
+
'type' => 'textarea',
|
1687 |
+
'value' => $css,
|
1688 |
+
'default' => '',
|
1689 |
+
'placeholder' => '',
|
1690 |
+
);
|
1691 |
+
|
1692 |
+
$settings_tabs_field->generate_field($args);
|
1693 |
+
|
1694 |
+
$args = array(
|
1695 |
+
'id' => 'css_hover',
|
1696 |
+
'css_id' => $element_index.'_css_hover',
|
1697 |
+
'parent' => $input_name.'[simplejobboard_company_tagline]',
|
1698 |
+
'title' => __('Hover CSS','post-grid'),
|
1699 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1700 |
+
'type' => 'textarea',
|
1701 |
+
'value' => $css_hover,
|
1702 |
+
'default' => '',
|
1703 |
+
'placeholder' => '',
|
1704 |
+
);
|
1705 |
+
|
1706 |
+
$settings_tabs_field->generate_field($args);
|
1707 |
+
|
1708 |
+
|
1709 |
+
ob_start();
|
1710 |
+
?>
|
1711 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1712 |
+
<?php
|
1713 |
+
|
1714 |
+
$html = ob_get_clean();
|
1715 |
+
|
1716 |
+
$args = array(
|
1717 |
+
'id' => 'use_css',
|
1718 |
+
'title' => __('Use of CSS','post-grid'),
|
1719 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1720 |
+
'type' => 'custom_html',
|
1721 |
+
'html' => $html,
|
1722 |
+
|
1723 |
+
);
|
1724 |
+
|
1725 |
+
$settings_tabs_field->generate_field($args);
|
1726 |
+
|
1727 |
+
?>
|
1728 |
+
|
1729 |
+
</div>
|
1730 |
+
</div>
|
1731 |
+
<?php
|
1732 |
+
|
1733 |
+
}
|
1734 |
+
|
1735 |
+
|
1736 |
+
|
1737 |
+
add_action('post_grid_layout_element_simplejobboard_company_tagline', 'post_grid_layout_element_simplejobboard_company_tagline');
|
1738 |
+
function post_grid_layout_element_simplejobboard_company_tagline($args){
|
1739 |
+
|
1740 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1741 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1742 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1743 |
+
|
1744 |
+
if(empty($post_id)) return;
|
1745 |
+
|
1746 |
+
|
1747 |
+
|
1748 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1749 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1750 |
+
|
1751 |
+
|
1752 |
+
|
1753 |
+
|
1754 |
+
$meta_value = get_post_meta($post_id, 'simple_job_board_company_tagline', true );
|
1755 |
+
|
1756 |
+
if(!empty($meta_value)):
|
1757 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
1758 |
+
|
1759 |
+
?>
|
1760 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_company_tagline ">
|
1761 |
+
<?php echo ($meta_value); ?>
|
1762 |
+
</div>
|
1763 |
+
<?php
|
1764 |
+
endif;
|
1765 |
+
|
1766 |
+
}
|
1767 |
+
|
1768 |
+
|
1769 |
+
|
1770 |
+
add_action('post_grid_layout_element_css_simplejobboard_company_tagline', 'post_grid_layout_element_css_simplejobboard_company_tagline', 10);
|
1771 |
+
function post_grid_layout_element_css_simplejobboard_company_tagline($args){
|
1772 |
+
|
1773 |
+
|
1774 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1775 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1776 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1777 |
+
|
1778 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1779 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1780 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1781 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1782 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1783 |
+
|
1784 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1785 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1786 |
+
|
1787 |
+
?>
|
1788 |
+
<style type="text/css">
|
1789 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1790 |
+
<?php if(!empty($color)): ?>
|
1791 |
+
color: <?php echo $color; ?>;
|
1792 |
+
<?php endif; ?>
|
1793 |
+
<?php if(!empty($font_size)): ?>
|
1794 |
+
font-size: <?php echo $font_size; ?>;
|
1795 |
+
<?php endif; ?>
|
1796 |
+
<?php if(!empty($font_family)): ?>
|
1797 |
+
font-family: <?php echo $font_family; ?>;
|
1798 |
+
<?php endif; ?>
|
1799 |
+
<?php if(!empty($margin)): ?>
|
1800 |
+
margin: <?php echo $margin; ?>;
|
1801 |
+
<?php endif; ?>
|
1802 |
+
<?php if(!empty($text_align)): ?>
|
1803 |
+
text-align: <?php echo $text_align; ?>;
|
1804 |
+
<?php endif; ?>
|
1805 |
+
<?php if(!empty($css)): ?>
|
1806 |
+
<?php echo $css; ?>
|
1807 |
+
<?php endif; ?>
|
1808 |
+
}
|
1809 |
+
<?php if(!empty($css_hover)): ?>
|
1810 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1811 |
+
<?php echo $css_hover; ?>
|
1812 |
+
}
|
1813 |
+
<?php endif; ?>
|
1814 |
+
</style>
|
1815 |
+
<?php
|
1816 |
+
}
|
1817 |
+
|
1818 |
+
|
1819 |
+
add_action('post_grid_layout_element_option_simplejobboard_job_expires','post_grid_layout_element_option_simplejobboard_job_expires');
|
1820 |
+
function post_grid_layout_element_option_simplejobboard_job_expires($parameters){
|
1821 |
+
|
1822 |
+
$settings_tabs_field = new settings_tabs_field();
|
1823 |
+
|
1824 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1825 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1826 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1827 |
+
|
1828 |
+
|
1829 |
+
|
1830 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1831 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1832 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1833 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1834 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1835 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1836 |
+
|
1837 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1838 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1839 |
+
|
1840 |
+
|
1841 |
+
|
1842 |
+
?>
|
1843 |
+
<div class="item">
|
1844 |
+
<div class="element-title header ">
|
1845 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1846 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1847 |
+
|
1848 |
+
<span class="expand"><?php echo __('Job expire date','post-grid'); ?></span>
|
1849 |
+
</div>
|
1850 |
+
<div class="element-options options">
|
1851 |
+
|
1852 |
+
<?php
|
1853 |
+
|
1854 |
+
|
1855 |
+
$args = array(
|
1856 |
+
'id' => 'wrapper_html',
|
1857 |
+
'css_id' => $element_index.'_wrapper_html',
|
1858 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1859 |
+
'title' => __('Wrapper html','post-grid'),
|
1860 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output.','post-grid'),
|
1861 |
+
'type' => 'text',
|
1862 |
+
'value' => $wrapper_html,
|
1863 |
+
'default' => '',
|
1864 |
+
'placeholder' => 'Expire date: %s',
|
1865 |
+
);
|
1866 |
+
|
1867 |
+
$settings_tabs_field->generate_field($args);
|
1868 |
+
|
1869 |
+
$args = array(
|
1870 |
+
'id' => 'color',
|
1871 |
+
'css_id' => $element_index.'_simplejobboard_job_expires',
|
1872 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1873 |
+
'title' => __('Color','post-grid'),
|
1874 |
+
'details' => __('Title text color.','post-grid'),
|
1875 |
+
'type' => 'colorpicker',
|
1876 |
+
'value' => $color,
|
1877 |
+
'default' => '',
|
1878 |
+
);
|
1879 |
+
|
1880 |
+
$settings_tabs_field->generate_field($args);
|
1881 |
+
|
1882 |
+
$args = array(
|
1883 |
+
'id' => 'font_size',
|
1884 |
+
'css_id' => $element_index.'_font_size',
|
1885 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1886 |
+
'title' => __('Font size','post-grid'),
|
1887 |
+
'details' => __('Set font size.','post-grid'),
|
1888 |
+
'type' => 'text',
|
1889 |
+
'value' => $font_size,
|
1890 |
+
'default' => '',
|
1891 |
+
'placeholder' => '14px',
|
1892 |
+
);
|
1893 |
+
|
1894 |
+
$settings_tabs_field->generate_field($args);
|
1895 |
+
|
1896 |
+
|
1897 |
+
$args = array(
|
1898 |
+
'id' => 'font_family',
|
1899 |
+
'css_id' => $element_index.'_font_family',
|
1900 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1901 |
+
'title' => __('Font family','post-grid'),
|
1902 |
+
'details' => __('Set font family.','post-grid'),
|
1903 |
+
'type' => 'text',
|
1904 |
+
'value' => $font_family,
|
1905 |
+
'default' => '',
|
1906 |
+
'placeholder' => 'Open Sans',
|
1907 |
+
);
|
1908 |
+
|
1909 |
+
$settings_tabs_field->generate_field($args);
|
1910 |
+
|
1911 |
+
|
1912 |
+
$args = array(
|
1913 |
+
'id' => 'margin',
|
1914 |
+
'css_id' => $element_index.'_margin',
|
1915 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1916 |
+
'title' => __('Margin','post-grid'),
|
1917 |
+
'details' => __('Set margin.','post-grid'),
|
1918 |
+
'type' => 'text',
|
1919 |
+
'value' => $margin,
|
1920 |
+
'default' => '',
|
1921 |
+
'placeholder' => '5px 0',
|
1922 |
+
);
|
1923 |
+
|
1924 |
+
$settings_tabs_field->generate_field($args);
|
1925 |
+
|
1926 |
+
|
1927 |
+
$args = array(
|
1928 |
+
'id' => 'text_align',
|
1929 |
+
'css_id' => $element_index.'_text_align',
|
1930 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1931 |
+
'title' => __('Text align','post-grid'),
|
1932 |
+
'details' => __('Choose text align.','post-grid'),
|
1933 |
+
'type' => 'select',
|
1934 |
+
'value' => $text_align,
|
1935 |
+
'default' => 'left',
|
1936 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1937 |
+
);
|
1938 |
+
|
1939 |
+
$settings_tabs_field->generate_field($args);
|
1940 |
+
|
1941 |
+
|
1942 |
+
$args = array(
|
1943 |
+
'id' => 'css',
|
1944 |
+
'css_id' => $element_index.'_css',
|
1945 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1946 |
+
'title' => __('Custom CSS','post-grid'),
|
1947 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1948 |
+
'type' => 'textarea',
|
1949 |
+
'value' => $css,
|
1950 |
+
'default' => '',
|
1951 |
+
'placeholder' => '',
|
1952 |
+
);
|
1953 |
+
|
1954 |
+
$settings_tabs_field->generate_field($args);
|
1955 |
+
|
1956 |
+
$args = array(
|
1957 |
+
'id' => 'css_hover',
|
1958 |
+
'css_id' => $element_index.'_css_hover',
|
1959 |
+
'parent' => $input_name.'[simplejobboard_job_expires]',
|
1960 |
+
'title' => __('Hover CSS','post-grid'),
|
1961 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1962 |
+
'type' => 'textarea',
|
1963 |
+
'value' => $css_hover,
|
1964 |
+
'default' => '',
|
1965 |
+
'placeholder' => '',
|
1966 |
+
);
|
1967 |
+
|
1968 |
+
$settings_tabs_field->generate_field($args);
|
1969 |
+
|
1970 |
+
|
1971 |
+
ob_start();
|
1972 |
+
?>
|
1973 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1974 |
+
<?php
|
1975 |
+
|
1976 |
+
$html = ob_get_clean();
|
1977 |
+
|
1978 |
+
$args = array(
|
1979 |
+
'id' => 'use_css',
|
1980 |
+
'title' => __('Use of CSS','post-grid'),
|
1981 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1982 |
+
'type' => 'custom_html',
|
1983 |
+
'html' => $html,
|
1984 |
+
|
1985 |
+
);
|
1986 |
+
|
1987 |
+
$settings_tabs_field->generate_field($args);
|
1988 |
+
|
1989 |
+
?>
|
1990 |
+
|
1991 |
+
</div>
|
1992 |
+
</div>
|
1993 |
+
<?php
|
1994 |
+
|
1995 |
+
}
|
1996 |
+
|
1997 |
+
|
1998 |
+
|
1999 |
+
add_action('post_grid_layout_element_simplejobboard_job_expires', 'post_grid_layout_element_simplejobboard_job_expires');
|
2000 |
+
function post_grid_layout_element_simplejobboard_job_expires($args){
|
2001 |
+
|
2002 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2003 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2004 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2005 |
+
|
2006 |
+
if(empty($post_id)) return;
|
2007 |
+
|
2008 |
+
|
2009 |
+
|
2010 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2011 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
2012 |
+
|
2013 |
+
|
2014 |
+
|
2015 |
+
|
2016 |
+
$meta_value = get_post_meta($post_id, '_job_expires', true );
|
2017 |
+
|
2018 |
+
|
2019 |
+
if(!empty($meta_value)):
|
2020 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
2021 |
+
|
2022 |
+
?>
|
2023 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_job_expires ">
|
2024 |
+
<?php echo ($meta_value); ?>
|
2025 |
+
</div>
|
2026 |
+
<?php
|
2027 |
+
endif;
|
2028 |
+
|
2029 |
+
}
|
2030 |
+
|
2031 |
+
|
2032 |
+
|
2033 |
+
add_action('post_grid_layout_element_css_simplejobboard_job_expires', 'post_grid_layout_element_css_simplejobboard_job_expires', 10);
|
2034 |
+
function post_grid_layout_element_css_simplejobboard_job_expires($args){
|
2035 |
+
|
2036 |
+
|
2037 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2038 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2039 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2040 |
+
|
2041 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2042 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2043 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2044 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2045 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2046 |
+
|
2047 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2048 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2049 |
+
|
2050 |
+
?>
|
2051 |
+
<style type="text/css">
|
2052 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2053 |
+
<?php if(!empty($color)): ?>
|
2054 |
+
color: <?php echo $color; ?>;
|
2055 |
+
<?php endif; ?>
|
2056 |
+
<?php if(!empty($font_size)): ?>
|
2057 |
+
font-size: <?php echo $font_size; ?>;
|
2058 |
+
<?php endif; ?>
|
2059 |
+
<?php if(!empty($font_family)): ?>
|
2060 |
+
font-family: <?php echo $font_family; ?>;
|
2061 |
+
<?php endif; ?>
|
2062 |
+
<?php if(!empty($margin)): ?>
|
2063 |
+
margin: <?php echo $margin; ?>;
|
2064 |
+
<?php endif; ?>
|
2065 |
+
<?php if(!empty($text_align)): ?>
|
2066 |
+
text-align: <?php echo $text_align; ?>;
|
2067 |
+
<?php endif; ?>
|
2068 |
+
<?php if(!empty($css)): ?>
|
2069 |
+
<?php echo $css; ?>
|
2070 |
+
<?php endif; ?>
|
2071 |
+
}
|
2072 |
+
<?php if(!empty($css_hover)): ?>
|
2073 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2074 |
+
<?php echo $css_hover; ?>
|
2075 |
+
}
|
2076 |
+
<?php endif; ?>
|
2077 |
+
</style>
|
2078 |
+
<?php
|
2079 |
+
}
|
2080 |
+
|
2081 |
+
|
2082 |
+
add_action('post_grid_layout_element_option_simplejobboard_job_feature','post_grid_layout_element_option_simplejobboard_job_feature');
|
2083 |
+
function post_grid_layout_element_option_simplejobboard_job_feature($parameters){
|
2084 |
+
|
2085 |
+
$settings_tabs_field = new settings_tabs_field();
|
2086 |
+
|
2087 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2088 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2089 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2090 |
+
|
2091 |
+
|
2092 |
+
$jobfeature_name = isset($element_data['jobfeature_name']) ? $element_data['jobfeature_name'] : '';
|
2093 |
+
|
2094 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2095 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2096 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2097 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2098 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2099 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
2100 |
+
|
2101 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
2102 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
2103 |
+
|
2104 |
+
|
2105 |
+
|
2106 |
+
?>
|
2107 |
+
<div class="item">
|
2108 |
+
<div class="element-title header ">
|
2109 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2110 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2111 |
+
|
2112 |
+
<span class="expand"><?php echo __('Job feature','post-grid'); ?></span>
|
2113 |
+
</div>
|
2114 |
+
<div class="element-options options">
|
2115 |
+
|
2116 |
+
<?php
|
2117 |
+
$args = array(
|
2118 |
+
'id' => 'jobfeature_name',
|
2119 |
+
'css_id' => $element_index.'_jobfeature_name',
|
2120 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2121 |
+
'title' => __('Jobfeature name','post-grid'),
|
2122 |
+
'details' => __('Write jobfeature id, ex: <code>jobfeature_id</code>','post-grid'),
|
2123 |
+
'type' => 'text',
|
2124 |
+
'value' => $jobfeature_name,
|
2125 |
+
'default' => '',
|
2126 |
+
'placeholder' => '',
|
2127 |
+
);
|
2128 |
+
|
2129 |
+
$settings_tabs_field->generate_field($args);
|
2130 |
+
|
2131 |
+
$args = array(
|
2132 |
+
'id' => 'wrapper_html',
|
2133 |
+
'css_id' => $element_index.'_wrapper_html',
|
2134 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2135 |
+
'title' => __('Wrapper html','post-grid'),
|
2136 |
+
'details' => __('Write wrapper html, use <code>%1$s : %2$s</code> to replace output. <code>Label: %1$s</code> <code>Value: %2$s</code> ','post-grid'),
|
2137 |
+
'type' => 'text',
|
2138 |
+
'value' => $wrapper_html,
|
2139 |
+
'default' => '',
|
2140 |
+
'placeholder' => '%1$s : %2$s',
|
2141 |
+
);
|
2142 |
+
|
2143 |
+
$settings_tabs_field->generate_field($args);
|
2144 |
+
|
2145 |
+
$args = array(
|
2146 |
+
'id' => 'color',
|
2147 |
+
'css_id' => $element_index.'_simplejobboard_job_feature',
|
2148 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2149 |
+
'title' => __('Color','post-grid'),
|
2150 |
+
'details' => __('Title text color.','post-grid'),
|
2151 |
+
'type' => 'colorpicker',
|
2152 |
+
'value' => $color,
|
2153 |
+
'default' => '',
|
2154 |
+
);
|
2155 |
+
|
2156 |
+
$settings_tabs_field->generate_field($args);
|
2157 |
+
|
2158 |
+
$args = array(
|
2159 |
+
'id' => 'font_size',
|
2160 |
+
'css_id' => $element_index.'_font_size',
|
2161 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2162 |
+
'title' => __('Font size','post-grid'),
|
2163 |
+
'details' => __('Set font size.','post-grid'),
|
2164 |
+
'type' => 'text',
|
2165 |
+
'value' => $font_size,
|
2166 |
+
'default' => '',
|
2167 |
+
'placeholder' => '14px',
|
2168 |
+
);
|
2169 |
+
|
2170 |
+
$settings_tabs_field->generate_field($args);
|
2171 |
+
|
2172 |
+
|
2173 |
+
$args = array(
|
2174 |
+
'id' => 'font_family',
|
2175 |
+
'css_id' => $element_index.'_font_family',
|
2176 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2177 |
+
'title' => __('Font family','post-grid'),
|
2178 |
+
'details' => __('Set font family.','post-grid'),
|
2179 |
+
'type' => 'text',
|
2180 |
+
'value' => $font_family,
|
2181 |
+
'default' => '',
|
2182 |
+
'placeholder' => 'Open Sans',
|
2183 |
+
);
|
2184 |
+
|
2185 |
+
$settings_tabs_field->generate_field($args);
|
2186 |
+
|
2187 |
+
|
2188 |
+
$args = array(
|
2189 |
+
'id' => 'margin',
|
2190 |
+
'css_id' => $element_index.'_margin',
|
2191 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2192 |
+
'title' => __('Margin','post-grid'),
|
2193 |
+
'details' => __('Set margin.','post-grid'),
|
2194 |
+
'type' => 'text',
|
2195 |
+
'value' => $margin,
|
2196 |
+
'default' => '',
|
2197 |
+
'placeholder' => '5px 0',
|
2198 |
+
);
|
2199 |
+
|
2200 |
+
$settings_tabs_field->generate_field($args);
|
2201 |
+
|
2202 |
+
|
2203 |
+
$args = array(
|
2204 |
+
'id' => 'text_align',
|
2205 |
+
'css_id' => $element_index.'_text_align',
|
2206 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2207 |
+
'title' => __('Text align','post-grid'),
|
2208 |
+
'details' => __('Choose text align.','post-grid'),
|
2209 |
+
'type' => 'select',
|
2210 |
+
'value' => $text_align,
|
2211 |
+
'default' => 'left',
|
2212 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
2213 |
+
);
|
2214 |
+
|
2215 |
+
$settings_tabs_field->generate_field($args);
|
2216 |
+
|
2217 |
+
|
2218 |
+
$args = array(
|
2219 |
+
'id' => 'css',
|
2220 |
+
'css_id' => $element_index.'_css',
|
2221 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2222 |
+
'title' => __('Custom CSS','post-grid'),
|
2223 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
2224 |
+
'type' => 'textarea',
|
2225 |
+
'value' => $css,
|
2226 |
+
'default' => '',
|
2227 |
+
'placeholder' => '',
|
2228 |
+
);
|
2229 |
+
|
2230 |
+
$settings_tabs_field->generate_field($args);
|
2231 |
+
|
2232 |
+
$args = array(
|
2233 |
+
'id' => 'css_hover',
|
2234 |
+
'css_id' => $element_index.'_css_hover',
|
2235 |
+
'parent' => $input_name.'[simplejobboard_job_feature]',
|
2236 |
+
'title' => __('Hover CSS','post-grid'),
|
2237 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
2238 |
+
'type' => 'textarea',
|
2239 |
+
'value' => $css_hover,
|
2240 |
+
'default' => '',
|
2241 |
+
'placeholder' => '',
|
2242 |
+
);
|
2243 |
+
|
2244 |
+
$settings_tabs_field->generate_field($args);
|
2245 |
+
|
2246 |
+
|
2247 |
+
ob_start();
|
2248 |
+
?>
|
2249 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
2250 |
+
<?php
|
2251 |
+
|
2252 |
+
$html = ob_get_clean();
|
2253 |
+
|
2254 |
+
$args = array(
|
2255 |
+
'id' => 'use_css',
|
2256 |
+
'title' => __('Use of CSS','post-grid'),
|
2257 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
2258 |
+
'type' => 'custom_html',
|
2259 |
+
'html' => $html,
|
2260 |
+
|
2261 |
+
);
|
2262 |
+
|
2263 |
+
$settings_tabs_field->generate_field($args);
|
2264 |
+
|
2265 |
+
?>
|
2266 |
+
|
2267 |
+
</div>
|
2268 |
+
</div>
|
2269 |
+
<?php
|
2270 |
+
|
2271 |
+
}
|
2272 |
+
|
2273 |
+
|
2274 |
+
|
2275 |
+
add_action('post_grid_layout_element_simplejobboard_job_feature', 'post_grid_layout_element_simplejobboard_job_feature');
|
2276 |
+
function post_grid_layout_element_simplejobboard_job_feature($args){
|
2277 |
+
|
2278 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2279 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2280 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2281 |
+
|
2282 |
+
if(empty($post_id)) return;
|
2283 |
+
|
2284 |
+
|
2285 |
+
|
2286 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2287 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%1$s : %2$s';
|
2288 |
+
$jobfeature_name = isset($element['jobfeature_name']) ? $element['jobfeature_name'] : '';
|
2289 |
+
|
2290 |
+
|
2291 |
+
|
2292 |
+
|
2293 |
+
$meta_value = get_post_meta($post_id, $jobfeature_name, true );
|
2294 |
+
|
2295 |
+
if(!empty($meta_value)):
|
2296 |
+
|
2297 |
+
|
2298 |
+
if(is_serialized($meta_value)){
|
2299 |
+
$meta_value = unserialize($meta_value);
|
2300 |
+
|
2301 |
+
$label = isset($meta_value['label']) ? $meta_value['label'] : '';
|
2302 |
+
$value = isset($meta_value['value']) ? $meta_value['value'] : '';
|
2303 |
+
|
2304 |
+
$meta_value = sprintf($wrapper_html, $label, $value);
|
2305 |
+
|
2306 |
+
}
|
2307 |
+
|
2308 |
+
|
2309 |
+
|
2310 |
+
|
2311 |
+
?>
|
2312 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_job_feature ">
|
2313 |
+
<?php echo ($meta_value); ?>
|
2314 |
+
</div>
|
2315 |
+
<?php
|
2316 |
+
endif;
|
2317 |
+
|
2318 |
+
}
|
2319 |
+
|
2320 |
+
|
2321 |
+
|
2322 |
+
add_action('post_grid_layout_element_css_simplejobboard_job_feature', 'post_grid_layout_element_css_simplejobboard_job_feature', 10);
|
2323 |
+
function post_grid_layout_element_css_simplejobboard_job_feature($args){
|
2324 |
+
|
2325 |
+
|
2326 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2327 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2328 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2329 |
+
|
2330 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2331 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2332 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2333 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2334 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2335 |
+
|
2336 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2337 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2338 |
+
|
2339 |
+
?>
|
2340 |
+
<style type="text/css">
|
2341 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2342 |
+
<?php if(!empty($color)): ?>
|
2343 |
+
color: <?php echo $color; ?>;
|
2344 |
+
<?php endif; ?>
|
2345 |
+
<?php if(!empty($font_size)): ?>
|
2346 |
+
font-size: <?php echo $font_size; ?>;
|
2347 |
+
<?php endif; ?>
|
2348 |
+
<?php if(!empty($font_family)): ?>
|
2349 |
+
font-family: <?php echo $font_family; ?>;
|
2350 |
+
<?php endif; ?>
|
2351 |
+
<?php if(!empty($margin)): ?>
|
2352 |
+
margin: <?php echo $margin; ?>;
|
2353 |
+
<?php endif; ?>
|
2354 |
+
<?php if(!empty($text_align)): ?>
|
2355 |
+
text-align: <?php echo $text_align; ?>;
|
2356 |
+
<?php endif; ?>
|
2357 |
+
<?php if(!empty($css)): ?>
|
2358 |
+
<?php echo $css; ?>
|
2359 |
+
<?php endif; ?>
|
2360 |
+
}
|
2361 |
+
<?php if(!empty($css_hover)): ?>
|
2362 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2363 |
+
<?php echo $css_hover; ?>
|
2364 |
+
}
|
2365 |
+
<?php endif; ?>
|
2366 |
+
</style>
|
2367 |
+
<?php
|
2368 |
+
}
|
2369 |
+
|
2370 |
+
add_action('post_grid_layout_element_option_simplejobboard_company_logo','post_grid_layout_element_option_simplejobboard_company_logo');
|
2371 |
+
function post_grid_layout_element_option_simplejobboard_company_logo($parameters){
|
2372 |
+
|
2373 |
+
$settings_tabs_field = new settings_tabs_field();
|
2374 |
+
|
2375 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2376 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2377 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2378 |
+
|
2379 |
+
|
2380 |
+
|
2381 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2382 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2383 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2384 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2385 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2386 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
2387 |
+
|
2388 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
2389 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
2390 |
+
|
2391 |
+
|
2392 |
+
|
2393 |
+
?>
|
2394 |
+
<div class="item">
|
2395 |
+
<div class="element-title header ">
|
2396 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2397 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2398 |
+
|
2399 |
+
<span class="expand"><?php echo __('Company logo','post-grid'); ?></span>
|
2400 |
+
</div>
|
2401 |
+
<div class="element-options options">
|
2402 |
+
|
2403 |
+
<?php
|
2404 |
+
|
2405 |
+
|
2406 |
+
$args = array(
|
2407 |
+
'id' => 'wrapper_html',
|
2408 |
+
'css_id' => $element_index.'_wrapper_html',
|
2409 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2410 |
+
'title' => __('Wrapper html','post-grid'),
|
2411 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output, ex: Image output<code><img src="%s" /></code> ','post-grid'),
|
2412 |
+
'type' => 'text',
|
2413 |
+
'value' => $wrapper_html,
|
2414 |
+
'default' => '',
|
2415 |
+
'placeholder' => 'Logo: %s',
|
2416 |
+
);
|
2417 |
+
|
2418 |
+
$settings_tabs_field->generate_field($args);
|
2419 |
+
|
2420 |
+
$args = array(
|
2421 |
+
'id' => 'color',
|
2422 |
+
'css_id' => $element_index.'_simplejobboard_company_logo',
|
2423 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2424 |
+
'title' => __('Color','post-grid'),
|
2425 |
+
'details' => __('Title text color.','post-grid'),
|
2426 |
+
'type' => 'colorpicker',
|
2427 |
+
'value' => $color,
|
2428 |
+
'default' => '',
|
2429 |
+
);
|
2430 |
+
|
2431 |
+
$settings_tabs_field->generate_field($args);
|
2432 |
+
|
2433 |
+
$args = array(
|
2434 |
+
'id' => 'font_size',
|
2435 |
+
'css_id' => $element_index.'_font_size',
|
2436 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2437 |
+
'title' => __('Font size','post-grid'),
|
2438 |
+
'details' => __('Set font size.','post-grid'),
|
2439 |
+
'type' => 'text',
|
2440 |
+
'value' => $font_size,
|
2441 |
+
'default' => '',
|
2442 |
+
'placeholder' => '14px',
|
2443 |
+
);
|
2444 |
+
|
2445 |
+
$settings_tabs_field->generate_field($args);
|
2446 |
+
|
2447 |
+
|
2448 |
+
$args = array(
|
2449 |
+
'id' => 'font_family',
|
2450 |
+
'css_id' => $element_index.'_font_family',
|
2451 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2452 |
+
'title' => __('Font family','post-grid'),
|
2453 |
+
'details' => __('Set font family.','post-grid'),
|
2454 |
+
'type' => 'text',
|
2455 |
+
'value' => $font_family,
|
2456 |
+
'default' => '',
|
2457 |
+
'placeholder' => 'Open Sans',
|
2458 |
+
);
|
2459 |
+
|
2460 |
+
$settings_tabs_field->generate_field($args);
|
2461 |
+
|
2462 |
+
|
2463 |
+
$args = array(
|
2464 |
+
'id' => 'margin',
|
2465 |
+
'css_id' => $element_index.'_margin',
|
2466 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2467 |
+
'title' => __('Margin','post-grid'),
|
2468 |
+
'details' => __('Set margin.','post-grid'),
|
2469 |
+
'type' => 'text',
|
2470 |
+
'value' => $margin,
|
2471 |
+
'default' => '',
|
2472 |
+
'placeholder' => '5px 0',
|
2473 |
+
);
|
2474 |
+
|
2475 |
+
$settings_tabs_field->generate_field($args);
|
2476 |
+
|
2477 |
+
|
2478 |
+
$args = array(
|
2479 |
+
'id' => 'text_align',
|
2480 |
+
'css_id' => $element_index.'_text_align',
|
2481 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2482 |
+
'title' => __('Text align','post-grid'),
|
2483 |
+
'details' => __('Choose text align.','post-grid'),
|
2484 |
+
'type' => 'select',
|
2485 |
+
'value' => $text_align,
|
2486 |
+
'default' => 'left',
|
2487 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
2488 |
+
);
|
2489 |
+
|
2490 |
+
$settings_tabs_field->generate_field($args);
|
2491 |
+
|
2492 |
+
|
2493 |
+
$args = array(
|
2494 |
+
'id' => 'css',
|
2495 |
+
'css_id' => $element_index.'_css',
|
2496 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2497 |
+
'title' => __('Custom CSS','post-grid'),
|
2498 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
2499 |
+
'type' => 'textarea',
|
2500 |
+
'value' => $css,
|
2501 |
+
'default' => '',
|
2502 |
+
'placeholder' => '',
|
2503 |
+
);
|
2504 |
+
|
2505 |
+
$settings_tabs_field->generate_field($args);
|
2506 |
+
|
2507 |
+
$args = array(
|
2508 |
+
'id' => 'css_hover',
|
2509 |
+
'css_id' => $element_index.'_css_hover',
|
2510 |
+
'parent' => $input_name.'[simplejobboard_company_logo]',
|
2511 |
+
'title' => __('Hover CSS','post-grid'),
|
2512 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
2513 |
+
'type' => 'textarea',
|
2514 |
+
'value' => $css_hover,
|
2515 |
+
'default' => '',
|
2516 |
+
'placeholder' => '',
|
2517 |
+
);
|
2518 |
+
|
2519 |
+
$settings_tabs_field->generate_field($args);
|
2520 |
+
|
2521 |
+
|
2522 |
+
ob_start();
|
2523 |
+
?>
|
2524 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
2525 |
+
<?php
|
2526 |
+
|
2527 |
+
$html = ob_get_clean();
|
2528 |
+
|
2529 |
+
$args = array(
|
2530 |
+
'id' => 'use_css',
|
2531 |
+
'title' => __('Use of CSS','post-grid'),
|
2532 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
2533 |
+
'type' => 'custom_html',
|
2534 |
+
'html' => $html,
|
2535 |
+
|
2536 |
+
);
|
2537 |
+
|
2538 |
+
$settings_tabs_field->generate_field($args);
|
2539 |
+
|
2540 |
+
?>
|
2541 |
+
|
2542 |
+
</div>
|
2543 |
+
</div>
|
2544 |
+
<?php
|
2545 |
+
|
2546 |
+
}
|
2547 |
+
|
2548 |
+
|
2549 |
+
|
2550 |
+
add_action('post_grid_layout_element_simplejobboard_company_logo', 'post_grid_layout_element_simplejobboard_company_logo');
|
2551 |
+
function post_grid_layout_element_simplejobboard_company_logo($args){
|
2552 |
+
|
2553 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2554 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2555 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2556 |
+
|
2557 |
+
if(empty($post_id)) return;
|
2558 |
+
|
2559 |
+
|
2560 |
+
|
2561 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2562 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
2563 |
+
|
2564 |
+
|
2565 |
+
|
2566 |
+
|
2567 |
+
$meta_value = get_post_meta($post_id, 'simple_job_board_company_logo', true );
|
2568 |
+
|
2569 |
+
|
2570 |
+
|
2571 |
+
|
2572 |
+
|
2573 |
+
if(!empty($meta_value)):
|
2574 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
2575 |
+
|
2576 |
+
?>
|
2577 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> simplejobboard_company_logo ">
|
2578 |
+
<?php echo ($meta_value); ?>
|
2579 |
+
</div>
|
2580 |
+
<?php
|
2581 |
+
endif;
|
2582 |
+
|
2583 |
+
}
|
2584 |
+
|
2585 |
+
|
2586 |
+
|
2587 |
+
add_action('post_grid_layout_element_css_simplejobboard_company_logo', 'post_grid_layout_element_css_simplejobboard_company_logo', 10);
|
2588 |
+
function post_grid_layout_element_css_simplejobboard_company_logo($args){
|
2589 |
+
|
2590 |
+
|
2591 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2592 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2593 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2594 |
+
|
2595 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2596 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2597 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2598 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2599 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2600 |
+
|
2601 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2602 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2603 |
+
|
2604 |
+
?>
|
2605 |
+
<style type="text/css">
|
2606 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2607 |
+
<?php if(!empty($color)): ?>
|
2608 |
+
color: <?php echo $color; ?>;
|
2609 |
+
<?php endif; ?>
|
2610 |
+
<?php if(!empty($font_size)): ?>
|
2611 |
+
font-size: <?php echo $font_size; ?>;
|
2612 |
+
<?php endif; ?>
|
2613 |
+
<?php if(!empty($font_family)): ?>
|
2614 |
+
font-family: <?php echo $font_family; ?>;
|
2615 |
+
<?php endif; ?>
|
2616 |
+
<?php if(!empty($margin)): ?>
|
2617 |
+
margin: <?php echo $margin; ?>;
|
2618 |
+
<?php endif; ?>
|
2619 |
+
<?php if(!empty($text_align)): ?>
|
2620 |
+
text-align: <?php echo $text_align; ?>;
|
2621 |
+
<?php endif; ?>
|
2622 |
+
<?php if(!empty($css)): ?>
|
2623 |
+
<?php echo $css; ?>
|
2624 |
+
<?php endif; ?>
|
2625 |
+
}
|
2626 |
+
<?php if(!empty($css_hover)): ?>
|
2627 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2628 |
+
<?php echo $css_hover; ?>
|
2629 |
+
}
|
2630 |
+
<?php endif; ?>
|
2631 |
+
</style>
|
2632 |
+
<?php
|
2633 |
+
}
|
2634 |
+
|
2635 |
+
|
2636 |
+
|
2637 |
+
|
2638 |
+
|
2639 |
+
|
2640 |
+
|
2641 |
+
|
2642 |
+
|
2643 |
+
|
2644 |
+
|
2645 |
+
|
2646 |
+
|
includes/layout-elements/wck-custom-fields-and-custom-post-types-creator/layout-elements.php
ADDED
@@ -0,0 +1,7854 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('post_grid_layout_elements','post_grid_pro_wck_layout_elements', 5);
|
5 |
+
|
6 |
+
function post_grid_pro_wck_layout_elements($elements_group){
|
7 |
+
|
8 |
+
$elements_group['wck'] = array(
|
9 |
+
'group_title'=>'WCK - Custom Fields Creator',
|
10 |
+
'items'=>array(
|
11 |
+
'wck_text'=>array('name' =>__('Text','post-grid')),
|
12 |
+
'wck_textarea'=>array('name' =>__('Textarea','post-grid')),
|
13 |
+
'wck_number'=>array('name' =>__('Number','post-grid')),
|
14 |
+
// 'wck_range'=>array('name' =>__('Range','post-grid')),
|
15 |
+
// 'wck_email'=>array('name' =>__('Email','post-grid')),
|
16 |
+
// 'wck_url'=>array('name' =>__('URL','post-grid')),
|
17 |
+
// 'wck_password'=>array('name' =>__('Password','post-grid')),
|
18 |
+
|
19 |
+
|
20 |
+
// 'wck_link'=>array('name' =>__('Link','post-grid')),
|
21 |
+
// 'wck_post_object'=>array('name' =>__('Post object','post-grid')),
|
22 |
+
// 'wck_page_link'=>array('name' =>__('Page link','post-grid')),
|
23 |
+
// 'wck_taxonomy'=>array('name' =>__('Taxonomy','post-grid')),
|
24 |
+
// 'wck_user'=>array('name' =>__('User','post-grid')),
|
25 |
+
// 'wck_relationship'=>array('name' =>__('Relationship','post-grid')),
|
26 |
+
|
27 |
+
'wck_upload'=>array('name' =>__('Upload','post-grid')),
|
28 |
+
// 'wck_file'=>array('name' =>__('File','post-grid')),
|
29 |
+
'wck_wysiwyg'=>array('name' =>__('Wysiwyg','post-grid')),
|
30 |
+
// 'wck_oembed'=>array('name' =>__('oEmbed','post-grid')),
|
31 |
+
|
32 |
+
'wck_select'=>array('name' =>__('Select','post-grid')),
|
33 |
+
'wck_checkbox'=>array('name' =>__('Checkbox','post-grid')),
|
34 |
+
'wck_radio'=>array('name' =>__('Radio','post-grid')),
|
35 |
+
// 'wck_buttongroup'=>array('name' =>__('Button group','post-grid')),
|
36 |
+
// 'wck_true_false'=>array('name' =>__('True / False','post-grid')),
|
37 |
+
|
38 |
+
// 'wck_date_picker'=>array('name' =>__('Date picker','post-grid')),
|
39 |
+
'wck_time_picker'=>array('name' =>__('Time picker','post-grid')),
|
40 |
+
// 'wck_datetime_picker'=>array('name' =>__('Datetime picker','post-grid')),
|
41 |
+
// 'wck_google_map'=>array('name' =>__('Google Map','post-grid')),
|
42 |
+
//'wck_colorpicker'=>array('name' =>__('Color picker','post-grid')),
|
43 |
+
|
44 |
+
|
45 |
+
),
|
46 |
+
);
|
47 |
+
|
48 |
+
return $elements_group;
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
add_action('post_grid_layout_element_option_wck_text','post_grid_layout_element_option_wck_text');
|
55 |
+
function post_grid_layout_element_option_wck_text($parameters){
|
56 |
+
|
57 |
+
$settings_tabs_field = new settings_tabs_field();
|
58 |
+
|
59 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
60 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
61 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
62 |
+
|
63 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
64 |
+
|
65 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
66 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
67 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
68 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
69 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
70 |
+
|
71 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
72 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
?>
|
77 |
+
<div class="item">
|
78 |
+
<div class="element-title header ">
|
79 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
80 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
81 |
+
|
82 |
+
<span class="expand"><?php echo __('WCK Text','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
83 |
+
</div>
|
84 |
+
<div class="element-options options">
|
85 |
+
|
86 |
+
<?php
|
87 |
+
|
88 |
+
$args = array(
|
89 |
+
'id' => 'wck_key',
|
90 |
+
'css_id' => $element_index.'_text',
|
91 |
+
'parent' => $input_name.'[wck_text]',
|
92 |
+
'title' => __('WCK key','post-grid'),
|
93 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
94 |
+
'type' => 'text',
|
95 |
+
'value' => $wck_key,
|
96 |
+
'default' => '',
|
97 |
+
'placeholder' => '',
|
98 |
+
);
|
99 |
+
|
100 |
+
$settings_tabs_field->generate_field($args);
|
101 |
+
|
102 |
+
$args = array(
|
103 |
+
'id' => 'color',
|
104 |
+
'css_id' => $element_index.'_wck_text',
|
105 |
+
'parent' => $input_name.'[wck_text]',
|
106 |
+
'title' => __('Color','post-grid'),
|
107 |
+
'details' => __('Title text color.','post-grid'),
|
108 |
+
'type' => 'colorpicker',
|
109 |
+
'value' => $color,
|
110 |
+
'default' => '',
|
111 |
+
);
|
112 |
+
|
113 |
+
$settings_tabs_field->generate_field($args);
|
114 |
+
|
115 |
+
$args = array(
|
116 |
+
'id' => 'font_size',
|
117 |
+
'css_id' => $element_index.'_font_size',
|
118 |
+
'parent' => $input_name.'[wck_text]',
|
119 |
+
'title' => __('Font size','post-grid'),
|
120 |
+
'details' => __('Set font size.','post-grid'),
|
121 |
+
'type' => 'text',
|
122 |
+
'value' => $font_size,
|
123 |
+
'default' => '',
|
124 |
+
'placeholder' => '14px',
|
125 |
+
);
|
126 |
+
|
127 |
+
$settings_tabs_field->generate_field($args);
|
128 |
+
|
129 |
+
|
130 |
+
$args = array(
|
131 |
+
'id' => 'font_family',
|
132 |
+
'css_id' => $element_index.'_font_family',
|
133 |
+
'parent' => $input_name.'[wck_text]',
|
134 |
+
'title' => __('Font family','post-grid'),
|
135 |
+
'details' => __('Set font family.','post-grid'),
|
136 |
+
'type' => 'text',
|
137 |
+
'value' => $font_family,
|
138 |
+
'default' => '',
|
139 |
+
'placeholder' => 'Open Sans',
|
140 |
+
);
|
141 |
+
|
142 |
+
$settings_tabs_field->generate_field($args);
|
143 |
+
|
144 |
+
|
145 |
+
$args = array(
|
146 |
+
'id' => 'margin',
|
147 |
+
'css_id' => $element_index.'_margin',
|
148 |
+
'parent' => $input_name.'[wck_text]',
|
149 |
+
'title' => __('Margin','post-grid'),
|
150 |
+
'details' => __('Set margin.','post-grid'),
|
151 |
+
'type' => 'text',
|
152 |
+
'value' => $margin,
|
153 |
+
'default' => '',
|
154 |
+
'placeholder' => '5px 0',
|
155 |
+
);
|
156 |
+
|
157 |
+
$settings_tabs_field->generate_field($args);
|
158 |
+
|
159 |
+
|
160 |
+
$args = array(
|
161 |
+
'id' => 'text_align',
|
162 |
+
'css_id' => $element_index.'_text_align',
|
163 |
+
'parent' => $input_name.'[wck_text]',
|
164 |
+
'title' => __('Text align','post-grid'),
|
165 |
+
'details' => __('Choose text align.','post-grid'),
|
166 |
+
'type' => 'select',
|
167 |
+
'value' => $text_align,
|
168 |
+
'default' => 'left',
|
169 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
170 |
+
);
|
171 |
+
|
172 |
+
$settings_tabs_field->generate_field($args);
|
173 |
+
|
174 |
+
|
175 |
+
$args = array(
|
176 |
+
'id' => 'css',
|
177 |
+
'css_id' => $element_index.'_css',
|
178 |
+
'parent' => $input_name.'[wck_text]',
|
179 |
+
'title' => __('Custom CSS','post-grid'),
|
180 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
181 |
+
'type' => 'textarea',
|
182 |
+
'value' => $css,
|
183 |
+
'default' => '',
|
184 |
+
'placeholder' => '',
|
185 |
+
);
|
186 |
+
|
187 |
+
$settings_tabs_field->generate_field($args);
|
188 |
+
|
189 |
+
$args = array(
|
190 |
+
'id' => 'css_hover',
|
191 |
+
'css_id' => $element_index.'_css_hover',
|
192 |
+
'parent' => $input_name.'[wck_text]',
|
193 |
+
'title' => __('Hover CSS','post-grid'),
|
194 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
195 |
+
'type' => 'textarea',
|
196 |
+
'value' => $css_hover,
|
197 |
+
'default' => '',
|
198 |
+
'placeholder' => '',
|
199 |
+
);
|
200 |
+
|
201 |
+
$settings_tabs_field->generate_field($args);
|
202 |
+
|
203 |
+
|
204 |
+
ob_start();
|
205 |
+
?>
|
206 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
207 |
+
<?php
|
208 |
+
|
209 |
+
$html = ob_get_clean();
|
210 |
+
|
211 |
+
$args = array(
|
212 |
+
'id' => 'use_css',
|
213 |
+
'title' => __('Use of CSS','post-grid'),
|
214 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
215 |
+
'type' => 'custom_html',
|
216 |
+
'html' => $html,
|
217 |
+
|
218 |
+
);
|
219 |
+
|
220 |
+
$settings_tabs_field->generate_field($args);
|
221 |
+
|
222 |
+
?>
|
223 |
+
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
<?php
|
227 |
+
|
228 |
+
}
|
229 |
+
|
230 |
+
|
231 |
+
|
232 |
+
add_action('post_grid_layout_element_wck_text', 'post_grid_layout_element_wck_text');
|
233 |
+
function post_grid_layout_element_wck_text($args){
|
234 |
+
|
235 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
236 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
237 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
238 |
+
|
239 |
+
if(empty($post_id)) return;
|
240 |
+
|
241 |
+
$title = get_the_title($post_id);
|
242 |
+
|
243 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
244 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
245 |
+
|
246 |
+
|
247 |
+
|
248 |
+
//var_dump($wck_key);
|
249 |
+
|
250 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
251 |
+
|
252 |
+
if(!empty($wck_value)):
|
253 |
+
|
254 |
+
?>
|
255 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_text ">
|
256 |
+
<?php echo esc_html($wck_value); ?>
|
257 |
+
</div>
|
258 |
+
<?php
|
259 |
+
endif;
|
260 |
+
|
261 |
+
}
|
262 |
+
|
263 |
+
|
264 |
+
|
265 |
+
add_action('post_grid_layout_element_css_wck_text', 'post_grid_layout_element_css_wck_text', 10);
|
266 |
+
function post_grid_layout_element_css_wck_text($args){
|
267 |
+
|
268 |
+
|
269 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
270 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
271 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
272 |
+
|
273 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
274 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
275 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
276 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
277 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
278 |
+
|
279 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
280 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
281 |
+
|
282 |
+
?>
|
283 |
+
<style type="text/css">
|
284 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
285 |
+
<?php if(!empty($color)): ?>
|
286 |
+
color: <?php echo $color; ?>;
|
287 |
+
<?php endif; ?>
|
288 |
+
<?php if(!empty($font_size)): ?>
|
289 |
+
font-size: <?php echo $font_size; ?>;
|
290 |
+
<?php endif; ?>
|
291 |
+
<?php if(!empty($font_family)): ?>
|
292 |
+
font-family: <?php echo $font_family; ?>;
|
293 |
+
<?php endif; ?>
|
294 |
+
<?php if(!empty($margin)): ?>
|
295 |
+
margin: <?php echo $margin; ?>;
|
296 |
+
<?php endif; ?>
|
297 |
+
<?php if(!empty($text_align)): ?>
|
298 |
+
text-align: <?php echo $text_align; ?>;
|
299 |
+
<?php endif; ?>
|
300 |
+
<?php if(!empty($css)): ?>
|
301 |
+
<?php echo $css; ?>
|
302 |
+
<?php endif; ?>
|
303 |
+
}
|
304 |
+
<?php if(!empty($css_hover)): ?>
|
305 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
306 |
+
<?php echo $css_hover; ?>
|
307 |
+
}
|
308 |
+
<?php endif; ?>
|
309 |
+
</style>
|
310 |
+
<?php
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
|
315 |
+
|
316 |
+
|
317 |
+
add_action('post_grid_layout_element_option_wck_textarea','post_grid_layout_element_option_wck_textarea');
|
318 |
+
function post_grid_layout_element_option_wck_textarea($parameters){
|
319 |
+
|
320 |
+
$settings_tabs_field = new settings_tabs_field();
|
321 |
+
|
322 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
323 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
324 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
325 |
+
|
326 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
327 |
+
|
328 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
329 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
330 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
331 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
332 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
333 |
+
|
334 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
335 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
?>
|
340 |
+
<div class="item">
|
341 |
+
<div class="element-title header ">
|
342 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
343 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
344 |
+
|
345 |
+
<span class="expand"><?php echo __('WCK Textarea','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
346 |
+
</div>
|
347 |
+
<div class="element-options options">
|
348 |
+
|
349 |
+
<?php
|
350 |
+
|
351 |
+
$args = array(
|
352 |
+
'id' => 'wck_key',
|
353 |
+
'css_id' => $element_index.'_text',
|
354 |
+
'parent' => $input_name.'[wck_textarea]',
|
355 |
+
'title' => __('WCK key','post-grid'),
|
356 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
357 |
+
'type' => 'text',
|
358 |
+
'value' => $wck_key,
|
359 |
+
'default' => '',
|
360 |
+
'placeholder' => '',
|
361 |
+
);
|
362 |
+
|
363 |
+
$settings_tabs_field->generate_field($args);
|
364 |
+
|
365 |
+
$args = array(
|
366 |
+
'id' => 'color',
|
367 |
+
'css_id' => $element_index.'_wck_textarea',
|
368 |
+
'parent' => $input_name.'[wck_textarea]',
|
369 |
+
'title' => __('Color','post-grid'),
|
370 |
+
'details' => __('Title text color.','post-grid'),
|
371 |
+
'type' => 'colorpicker',
|
372 |
+
'value' => $color,
|
373 |
+
'default' => '',
|
374 |
+
);
|
375 |
+
|
376 |
+
$settings_tabs_field->generate_field($args);
|
377 |
+
|
378 |
+
$args = array(
|
379 |
+
'id' => 'font_size',
|
380 |
+
'css_id' => $element_index.'_font_size',
|
381 |
+
'parent' => $input_name.'[wck_textarea]',
|
382 |
+
'title' => __('Font size','post-grid'),
|
383 |
+
'details' => __('Set font size.','post-grid'),
|
384 |
+
'type' => 'text',
|
385 |
+
'value' => $font_size,
|
386 |
+
'default' => '',
|
387 |
+
'placeholder' => '14px',
|
388 |
+
);
|
389 |
+
|
390 |
+
$settings_tabs_field->generate_field($args);
|
391 |
+
|
392 |
+
|
393 |
+
$args = array(
|
394 |
+
'id' => 'font_family',
|
395 |
+
'css_id' => $element_index.'_font_family',
|
396 |
+
'parent' => $input_name.'[wck_textarea]',
|
397 |
+
'title' => __('Font family','post-grid'),
|
398 |
+
'details' => __('Set font family.','post-grid'),
|
399 |
+
'type' => 'text',
|
400 |
+
'value' => $font_family,
|
401 |
+
'default' => '',
|
402 |
+
'placeholder' => 'Open Sans',
|
403 |
+
);
|
404 |
+
|
405 |
+
$settings_tabs_field->generate_field($args);
|
406 |
+
|
407 |
+
|
408 |
+
$args = array(
|
409 |
+
'id' => 'margin',
|
410 |
+
'css_id' => $element_index.'_margin',
|
411 |
+
'parent' => $input_name.'[wck_textarea]',
|
412 |
+
'title' => __('Margin','post-grid'),
|
413 |
+
'details' => __('Set margin.','post-grid'),
|
414 |
+
'type' => 'text',
|
415 |
+
'value' => $margin,
|
416 |
+
'default' => '',
|
417 |
+
'placeholder' => '5px 0',
|
418 |
+
);
|
419 |
+
|
420 |
+
$settings_tabs_field->generate_field($args);
|
421 |
+
|
422 |
+
|
423 |
+
$args = array(
|
424 |
+
'id' => 'text_align',
|
425 |
+
'css_id' => $element_index.'_text_align',
|
426 |
+
'parent' => $input_name.'[wck_textarea]',
|
427 |
+
'title' => __('Text align','post-grid'),
|
428 |
+
'details' => __('Choose text align.','post-grid'),
|
429 |
+
'type' => 'select',
|
430 |
+
'value' => $text_align,
|
431 |
+
'default' => 'left',
|
432 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
433 |
+
);
|
434 |
+
|
435 |
+
$settings_tabs_field->generate_field($args);
|
436 |
+
|
437 |
+
|
438 |
+
$args = array(
|
439 |
+
'id' => 'css',
|
440 |
+
'css_id' => $element_index.'_css',
|
441 |
+
'parent' => $input_name.'[wck_textarea]',
|
442 |
+
'title' => __('Custom CSS','post-grid'),
|
443 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
444 |
+
'type' => 'textarea',
|
445 |
+
'value' => $css,
|
446 |
+
'default' => '',
|
447 |
+
'placeholder' => '',
|
448 |
+
);
|
449 |
+
|
450 |
+
$settings_tabs_field->generate_field($args);
|
451 |
+
|
452 |
+
$args = array(
|
453 |
+
'id' => 'css_hover',
|
454 |
+
'css_id' => $element_index.'_css_hover',
|
455 |
+
'parent' => $input_name.'[wck_textarea]',
|
456 |
+
'title' => __('Hover CSS','post-grid'),
|
457 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
458 |
+
'type' => 'textarea',
|
459 |
+
'value' => $css_hover,
|
460 |
+
'default' => '',
|
461 |
+
'placeholder' => '',
|
462 |
+
);
|
463 |
+
|
464 |
+
$settings_tabs_field->generate_field($args);
|
465 |
+
|
466 |
+
|
467 |
+
ob_start();
|
468 |
+
?>
|
469 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
470 |
+
<?php
|
471 |
+
|
472 |
+
$html = ob_get_clean();
|
473 |
+
|
474 |
+
$args = array(
|
475 |
+
'id' => 'use_css',
|
476 |
+
'title' => __('Use of CSS','post-grid'),
|
477 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
478 |
+
'type' => 'custom_html',
|
479 |
+
'html' => $html,
|
480 |
+
|
481 |
+
);
|
482 |
+
|
483 |
+
$settings_tabs_field->generate_field($args);
|
484 |
+
|
485 |
+
?>
|
486 |
+
|
487 |
+
</div>
|
488 |
+
</div>
|
489 |
+
<?php
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
+
|
494 |
+
|
495 |
+
add_action('post_grid_layout_element_wck_textarea', 'post_grid_layout_element_wck_textarea');
|
496 |
+
function post_grid_layout_element_wck_textarea($args){
|
497 |
+
|
498 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
499 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
500 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
501 |
+
|
502 |
+
if(empty($post_id)) return;
|
503 |
+
|
504 |
+
$title = get_the_title($post_id);
|
505 |
+
|
506 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
507 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
508 |
+
|
509 |
+
|
510 |
+
|
511 |
+
//var_dump($wck_key);
|
512 |
+
|
513 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
514 |
+
|
515 |
+
if(!empty($wck_value)):
|
516 |
+
|
517 |
+
?>
|
518 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_textarea ">
|
519 |
+
<?php echo ($wck_value); ?>
|
520 |
+
</div>
|
521 |
+
<?php
|
522 |
+
endif;
|
523 |
+
|
524 |
+
}
|
525 |
+
|
526 |
+
|
527 |
+
|
528 |
+
add_action('post_grid_layout_element_css_wck_textarea', 'post_grid_layout_element_css_wck_textarea', 10);
|
529 |
+
function post_grid_layout_element_css_wck_textarea($args){
|
530 |
+
|
531 |
+
|
532 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
533 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
534 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
535 |
+
|
536 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
537 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
538 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
539 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
540 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
541 |
+
|
542 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
543 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
544 |
+
|
545 |
+
?>
|
546 |
+
<style type="text/css">
|
547 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
548 |
+
<?php if(!empty($color)): ?>
|
549 |
+
color: <?php echo $color; ?>;
|
550 |
+
<?php endif; ?>
|
551 |
+
<?php if(!empty($font_size)): ?>
|
552 |
+
font-size: <?php echo $font_size; ?>;
|
553 |
+
<?php endif; ?>
|
554 |
+
<?php if(!empty($font_family)): ?>
|
555 |
+
font-family: <?php echo $font_family; ?>;
|
556 |
+
<?php endif; ?>
|
557 |
+
<?php if(!empty($margin)): ?>
|
558 |
+
margin: <?php echo $margin; ?>;
|
559 |
+
<?php endif; ?>
|
560 |
+
<?php if(!empty($text_align)): ?>
|
561 |
+
text-align: <?php echo $text_align; ?>;
|
562 |
+
<?php endif; ?>
|
563 |
+
<?php if(!empty($css)): ?>
|
564 |
+
<?php echo $css; ?>
|
565 |
+
<?php endif; ?>
|
566 |
+
}
|
567 |
+
<?php if(!empty($css_hover)): ?>
|
568 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
569 |
+
<?php echo $css_hover; ?>
|
570 |
+
}
|
571 |
+
<?php endif; ?>
|
572 |
+
</style>
|
573 |
+
<?php
|
574 |
+
}
|
575 |
+
|
576 |
+
|
577 |
+
|
578 |
+
|
579 |
+
|
580 |
+
add_action('post_grid_layout_element_option_wck_number','post_grid_layout_element_option_wck_number');
|
581 |
+
function post_grid_layout_element_option_wck_number($parameters){
|
582 |
+
|
583 |
+
$settings_tabs_field = new settings_tabs_field();
|
584 |
+
|
585 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
586 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
587 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
588 |
+
|
589 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
590 |
+
|
591 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
592 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
593 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
594 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
595 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
596 |
+
|
597 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
598 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
599 |
+
|
600 |
+
|
601 |
+
|
602 |
+
?>
|
603 |
+
<div class="item">
|
604 |
+
<div class="element-title header ">
|
605 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
606 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
607 |
+
|
608 |
+
<span class="expand"><?php echo __('WCK Number','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
609 |
+
</div>
|
610 |
+
<div class="element-options options">
|
611 |
+
|
612 |
+
<?php
|
613 |
+
|
614 |
+
$args = array(
|
615 |
+
'id' => 'wck_key',
|
616 |
+
'css_id' => $element_index.'_text',
|
617 |
+
'parent' => $input_name.'[wck_number]',
|
618 |
+
'title' => __('WCK key','post-grid'),
|
619 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
620 |
+
'type' => 'text',
|
621 |
+
'value' => $wck_key,
|
622 |
+
'default' => '',
|
623 |
+
'placeholder' => '',
|
624 |
+
);
|
625 |
+
|
626 |
+
$settings_tabs_field->generate_field($args);
|
627 |
+
|
628 |
+
$args = array(
|
629 |
+
'id' => 'color',
|
630 |
+
'css_id' => $element_index.'_wck_number',
|
631 |
+
'parent' => $input_name.'[wck_number]',
|
632 |
+
'title' => __('Color','post-grid'),
|
633 |
+
'details' => __('Title text color.','post-grid'),
|
634 |
+
'type' => 'colorpicker',
|
635 |
+
'value' => $color,
|
636 |
+
'default' => '',
|
637 |
+
);
|
638 |
+
|
639 |
+
$settings_tabs_field->generate_field($args);
|
640 |
+
|
641 |
+
$args = array(
|
642 |
+
'id' => 'font_size',
|
643 |
+
'css_id' => $element_index.'_font_size',
|
644 |
+
'parent' => $input_name.'[wck_number]',
|
645 |
+
'title' => __('Font size','post-grid'),
|
646 |
+
'details' => __('Set font size.','post-grid'),
|
647 |
+
'type' => 'text',
|
648 |
+
'value' => $font_size,
|
649 |
+
'default' => '',
|
650 |
+
'placeholder' => '14px',
|
651 |
+
);
|
652 |
+
|
653 |
+
$settings_tabs_field->generate_field($args);
|
654 |
+
|
655 |
+
|
656 |
+
$args = array(
|
657 |
+
'id' => 'font_family',
|
658 |
+
'css_id' => $element_index.'_font_family',
|
659 |
+
'parent' => $input_name.'[wck_number]',
|
660 |
+
'title' => __('Font family','post-grid'),
|
661 |
+
'details' => __('Set font family.','post-grid'),
|
662 |
+
'type' => 'text',
|
663 |
+
'value' => $font_family,
|
664 |
+
'default' => '',
|
665 |
+
'placeholder' => 'Open Sans',
|
666 |
+
);
|
667 |
+
|
668 |
+
$settings_tabs_field->generate_field($args);
|
669 |
+
|
670 |
+
|
671 |
+
$args = array(
|
672 |
+
'id' => 'margin',
|
673 |
+
'css_id' => $element_index.'_margin',
|
674 |
+
'parent' => $input_name.'[wck_number]',
|
675 |
+
'title' => __('Margin','post-grid'),
|
676 |
+
'details' => __('Set margin.','post-grid'),
|
677 |
+
'type' => 'text',
|
678 |
+
'value' => $margin,
|
679 |
+
'default' => '',
|
680 |
+
'placeholder' => '5px 0',
|
681 |
+
);
|
682 |
+
|
683 |
+
$settings_tabs_field->generate_field($args);
|
684 |
+
|
685 |
+
|
686 |
+
$args = array(
|
687 |
+
'id' => 'text_align',
|
688 |
+
'css_id' => $element_index.'_text_align',
|
689 |
+
'parent' => $input_name.'[wck_number]',
|
690 |
+
'title' => __('Text align','post-grid'),
|
691 |
+
'details' => __('Choose text align.','post-grid'),
|
692 |
+
'type' => 'select',
|
693 |
+
'value' => $text_align,
|
694 |
+
'default' => 'left',
|
695 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
696 |
+
);
|
697 |
+
|
698 |
+
$settings_tabs_field->generate_field($args);
|
699 |
+
|
700 |
+
|
701 |
+
$args = array(
|
702 |
+
'id' => 'css',
|
703 |
+
'css_id' => $element_index.'_css',
|
704 |
+
'parent' => $input_name.'[wck_number]',
|
705 |
+
'title' => __('Custom CSS','post-grid'),
|
706 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
707 |
+
'type' => 'textarea',
|
708 |
+
'value' => $css,
|
709 |
+
'default' => '',
|
710 |
+
'placeholder' => '',
|
711 |
+
);
|
712 |
+
|
713 |
+
$settings_tabs_field->generate_field($args);
|
714 |
+
|
715 |
+
$args = array(
|
716 |
+
'id' => 'css_hover',
|
717 |
+
'css_id' => $element_index.'_css_hover',
|
718 |
+
'parent' => $input_name.'[wck_number]',
|
719 |
+
'title' => __('Hover CSS','post-grid'),
|
720 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
721 |
+
'type' => 'textarea',
|
722 |
+
'value' => $css_hover,
|
723 |
+
'default' => '',
|
724 |
+
'placeholder' => '',
|
725 |
+
);
|
726 |
+
|
727 |
+
$settings_tabs_field->generate_field($args);
|
728 |
+
|
729 |
+
|
730 |
+
ob_start();
|
731 |
+
?>
|
732 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
733 |
+
<?php
|
734 |
+
|
735 |
+
$html = ob_get_clean();
|
736 |
+
|
737 |
+
$args = array(
|
738 |
+
'id' => 'use_css',
|
739 |
+
'title' => __('Use of CSS','post-grid'),
|
740 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
741 |
+
'type' => 'custom_html',
|
742 |
+
'html' => $html,
|
743 |
+
|
744 |
+
);
|
745 |
+
|
746 |
+
$settings_tabs_field->generate_field($args);
|
747 |
+
|
748 |
+
?>
|
749 |
+
|
750 |
+
</div>
|
751 |
+
</div>
|
752 |
+
<?php
|
753 |
+
|
754 |
+
}
|
755 |
+
|
756 |
+
|
757 |
+
|
758 |
+
add_action('post_grid_layout_element_wck_number', 'post_grid_layout_element_wck_number');
|
759 |
+
function post_grid_layout_element_wck_number($args){
|
760 |
+
|
761 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
762 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
763 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
764 |
+
|
765 |
+
if(empty($post_id)) return;
|
766 |
+
|
767 |
+
$title = get_the_title($post_id);
|
768 |
+
|
769 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
770 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
771 |
+
|
772 |
+
|
773 |
+
|
774 |
+
//var_dump($wck_key);
|
775 |
+
|
776 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
777 |
+
|
778 |
+
if(!empty($wck_value)):
|
779 |
+
|
780 |
+
?>
|
781 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_number ">
|
782 |
+
<?php echo esc_html($wck_value); ?>
|
783 |
+
</div>
|
784 |
+
<?php
|
785 |
+
endif;
|
786 |
+
|
787 |
+
}
|
788 |
+
|
789 |
+
|
790 |
+
|
791 |
+
add_action('post_grid_layout_element_css_wck_number', 'post_grid_layout_element_css_wck_number', 10);
|
792 |
+
function post_grid_layout_element_css_wck_number($args){
|
793 |
+
|
794 |
+
|
795 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
796 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
797 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
798 |
+
|
799 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
800 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
801 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
802 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
803 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
804 |
+
|
805 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
806 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
807 |
+
|
808 |
+
?>
|
809 |
+
<style type="text/css">
|
810 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
811 |
+
<?php if(!empty($color)): ?>
|
812 |
+
color: <?php echo $color; ?>;
|
813 |
+
<?php endif; ?>
|
814 |
+
<?php if(!empty($font_size)): ?>
|
815 |
+
font-size: <?php echo $font_size; ?>;
|
816 |
+
<?php endif; ?>
|
817 |
+
<?php if(!empty($font_family)): ?>
|
818 |
+
font-family: <?php echo $font_family; ?>;
|
819 |
+
<?php endif; ?>
|
820 |
+
<?php if(!empty($margin)): ?>
|
821 |
+
margin: <?php echo $margin; ?>;
|
822 |
+
<?php endif; ?>
|
823 |
+
<?php if(!empty($text_align)): ?>
|
824 |
+
text-align: <?php echo $text_align; ?>;
|
825 |
+
<?php endif; ?>
|
826 |
+
<?php if(!empty($css)): ?>
|
827 |
+
<?php echo $css; ?>
|
828 |
+
<?php endif; ?>
|
829 |
+
}
|
830 |
+
<?php if(!empty($css_hover)): ?>
|
831 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
832 |
+
<?php echo $css_hover; ?>
|
833 |
+
}
|
834 |
+
<?php endif; ?>
|
835 |
+
</style>
|
836 |
+
<?php
|
837 |
+
}
|
838 |
+
|
839 |
+
|
840 |
+
|
841 |
+
add_action('post_grid_layout_element_option_wck_email','post_grid_layout_element_option_wck_email');
|
842 |
+
function post_grid_layout_element_option_wck_email($parameters){
|
843 |
+
|
844 |
+
$settings_tabs_field = new settings_tabs_field();
|
845 |
+
|
846 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
847 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
848 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
849 |
+
|
850 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
851 |
+
|
852 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
853 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
854 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
855 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
856 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
857 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
858 |
+
|
859 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
860 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
861 |
+
|
862 |
+
|
863 |
+
|
864 |
+
?>
|
865 |
+
<div class="item">
|
866 |
+
<div class="element-title header ">
|
867 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
868 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
869 |
+
|
870 |
+
<span class="expand"><?php echo __('WCK Email','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
871 |
+
</div>
|
872 |
+
<div class="element-options options">
|
873 |
+
|
874 |
+
<?php
|
875 |
+
|
876 |
+
$args = array(
|
877 |
+
'id' => 'wck_key',
|
878 |
+
'css_id' => $element_index.'_text',
|
879 |
+
'parent' => $input_name.'[wck_email]',
|
880 |
+
'title' => __('WCK key','post-grid'),
|
881 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
882 |
+
'type' => 'text',
|
883 |
+
'value' => $wck_key,
|
884 |
+
'default' => '',
|
885 |
+
'placeholder' => '',
|
886 |
+
);
|
887 |
+
|
888 |
+
$settings_tabs_field->generate_field($args);
|
889 |
+
|
890 |
+
|
891 |
+
$args = array(
|
892 |
+
'id' => 'wrapper_html',
|
893 |
+
'css_id' => $element_index.'_wrapper_html',
|
894 |
+
'parent' => $input_name.'[wck_email]',
|
895 |
+
'title' => __('Wrapper html','post-grid'),
|
896 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Email: <a href="mailto:%s">Send mail</a></code>','post-grid'),
|
897 |
+
'type' => 'text',
|
898 |
+
'value' => $wrapper_html,
|
899 |
+
'default' => '',
|
900 |
+
'placeholder' => 'Email: %s',
|
901 |
+
);
|
902 |
+
|
903 |
+
$settings_tabs_field->generate_field($args);
|
904 |
+
|
905 |
+
$args = array(
|
906 |
+
'id' => 'color',
|
907 |
+
'css_id' => $element_index.'_wck_email',
|
908 |
+
'parent' => $input_name.'[wck_email]',
|
909 |
+
'title' => __('Color','post-grid'),
|
910 |
+
'details' => __('Title text color.','post-grid'),
|
911 |
+
'type' => 'colorpicker',
|
912 |
+
'value' => $color,
|
913 |
+
'default' => '',
|
914 |
+
);
|
915 |
+
|
916 |
+
$settings_tabs_field->generate_field($args);
|
917 |
+
|
918 |
+
$args = array(
|
919 |
+
'id' => 'font_size',
|
920 |
+
'css_id' => $element_index.'_font_size',
|
921 |
+
'parent' => $input_name.'[wck_email]',
|
922 |
+
'title' => __('Font size','post-grid'),
|
923 |
+
'details' => __('Set font size.','post-grid'),
|
924 |
+
'type' => 'text',
|
925 |
+
'value' => $font_size,
|
926 |
+
'default' => '',
|
927 |
+
'placeholder' => '14px',
|
928 |
+
);
|
929 |
+
|
930 |
+
$settings_tabs_field->generate_field($args);
|
931 |
+
|
932 |
+
|
933 |
+
$args = array(
|
934 |
+
'id' => 'font_family',
|
935 |
+
'css_id' => $element_index.'_font_family',
|
936 |
+
'parent' => $input_name.'[wck_email]',
|
937 |
+
'title' => __('Font family','post-grid'),
|
938 |
+
'details' => __('Set font family.','post-grid'),
|
939 |
+
'type' => 'text',
|
940 |
+
'value' => $font_family,
|
941 |
+
'default' => '',
|
942 |
+
'placeholder' => 'Open Sans',
|
943 |
+
);
|
944 |
+
|
945 |
+
$settings_tabs_field->generate_field($args);
|
946 |
+
|
947 |
+
|
948 |
+
$args = array(
|
949 |
+
'id' => 'margin',
|
950 |
+
'css_id' => $element_index.'_margin',
|
951 |
+
'parent' => $input_name.'[wck_email]',
|
952 |
+
'title' => __('Margin','post-grid'),
|
953 |
+
'details' => __('Set margin.','post-grid'),
|
954 |
+
'type' => 'text',
|
955 |
+
'value' => $margin,
|
956 |
+
'default' => '',
|
957 |
+
'placeholder' => '5px 0',
|
958 |
+
);
|
959 |
+
|
960 |
+
$settings_tabs_field->generate_field($args);
|
961 |
+
|
962 |
+
|
963 |
+
$args = array(
|
964 |
+
'id' => 'text_align',
|
965 |
+
'css_id' => $element_index.'_text_align',
|
966 |
+
'parent' => $input_name.'[wck_email]',
|
967 |
+
'title' => __('Text align','post-grid'),
|
968 |
+
'details' => __('Choose text align.','post-grid'),
|
969 |
+
'type' => 'select',
|
970 |
+
'value' => $text_align,
|
971 |
+
'default' => 'left',
|
972 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
973 |
+
);
|
974 |
+
|
975 |
+
$settings_tabs_field->generate_field($args);
|
976 |
+
|
977 |
+
|
978 |
+
$args = array(
|
979 |
+
'id' => 'css',
|
980 |
+
'css_id' => $element_index.'_css',
|
981 |
+
'parent' => $input_name.'[wck_email]',
|
982 |
+
'title' => __('Custom CSS','post-grid'),
|
983 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
984 |
+
'type' => 'textarea',
|
985 |
+
'value' => $css,
|
986 |
+
'default' => '',
|
987 |
+
'placeholder' => '',
|
988 |
+
);
|
989 |
+
|
990 |
+
$settings_tabs_field->generate_field($args);
|
991 |
+
|
992 |
+
$args = array(
|
993 |
+
'id' => 'css_hover',
|
994 |
+
'css_id' => $element_index.'_css_hover',
|
995 |
+
'parent' => $input_name.'[wck_email]',
|
996 |
+
'title' => __('Hover CSS','post-grid'),
|
997 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
998 |
+
'type' => 'textarea',
|
999 |
+
'value' => $css_hover,
|
1000 |
+
'default' => '',
|
1001 |
+
'placeholder' => '',
|
1002 |
+
);
|
1003 |
+
|
1004 |
+
$settings_tabs_field->generate_field($args);
|
1005 |
+
|
1006 |
+
|
1007 |
+
ob_start();
|
1008 |
+
?>
|
1009 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1010 |
+
<?php
|
1011 |
+
|
1012 |
+
$html = ob_get_clean();
|
1013 |
+
|
1014 |
+
$args = array(
|
1015 |
+
'id' => 'use_css',
|
1016 |
+
'title' => __('Use of CSS','post-grid'),
|
1017 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1018 |
+
'type' => 'custom_html',
|
1019 |
+
'html' => $html,
|
1020 |
+
|
1021 |
+
);
|
1022 |
+
|
1023 |
+
$settings_tabs_field->generate_field($args);
|
1024 |
+
|
1025 |
+
?>
|
1026 |
+
|
1027 |
+
</div>
|
1028 |
+
</div>
|
1029 |
+
<?php
|
1030 |
+
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
|
1034 |
+
|
1035 |
+
add_action('post_grid_layout_element_wck_email', 'post_grid_layout_element_wck_email');
|
1036 |
+
function post_grid_layout_element_wck_email($args){
|
1037 |
+
|
1038 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1039 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1040 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1041 |
+
|
1042 |
+
if(empty($post_id)) return;
|
1043 |
+
|
1044 |
+
$title = get_the_title($post_id);
|
1045 |
+
|
1046 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1047 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
1048 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1049 |
+
|
1050 |
+
|
1051 |
+
|
1052 |
+
//var_dump($wck_key);
|
1053 |
+
|
1054 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
1055 |
+
|
1056 |
+
if(!empty($wck_value)):
|
1057 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
1058 |
+
|
1059 |
+
?>
|
1060 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_email ">
|
1061 |
+
<?php echo ($wck_value); ?>
|
1062 |
+
</div>
|
1063 |
+
<?php
|
1064 |
+
endif;
|
1065 |
+
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
|
1069 |
+
|
1070 |
+
add_action('post_grid_layout_element_css_wck_email', 'post_grid_layout_element_css_wck_email', 10);
|
1071 |
+
function post_grid_layout_element_css_wck_email($args){
|
1072 |
+
|
1073 |
+
|
1074 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1075 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1076 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1077 |
+
|
1078 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1079 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1080 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1081 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1082 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1083 |
+
|
1084 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1085 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1086 |
+
|
1087 |
+
?>
|
1088 |
+
<style type="text/css">
|
1089 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1090 |
+
<?php if(!empty($color)): ?>
|
1091 |
+
color: <?php echo $color; ?>;
|
1092 |
+
<?php endif; ?>
|
1093 |
+
<?php if(!empty($font_size)): ?>
|
1094 |
+
font-size: <?php echo $font_size; ?>;
|
1095 |
+
<?php endif; ?>
|
1096 |
+
<?php if(!empty($font_family)): ?>
|
1097 |
+
font-family: <?php echo $font_family; ?>;
|
1098 |
+
<?php endif; ?>
|
1099 |
+
<?php if(!empty($margin)): ?>
|
1100 |
+
margin: <?php echo $margin; ?>;
|
1101 |
+
<?php endif; ?>
|
1102 |
+
<?php if(!empty($text_align)): ?>
|
1103 |
+
text-align: <?php echo $text_align; ?>;
|
1104 |
+
<?php endif; ?>
|
1105 |
+
<?php if(!empty($css)): ?>
|
1106 |
+
<?php echo $css; ?>
|
1107 |
+
<?php endif; ?>
|
1108 |
+
}
|
1109 |
+
<?php if(!empty($css_hover)): ?>
|
1110 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1111 |
+
<?php echo $css_hover; ?>
|
1112 |
+
}
|
1113 |
+
<?php endif; ?>
|
1114 |
+
</style>
|
1115 |
+
<?php
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
|
1119 |
+
add_action('post_grid_layout_element_option_wck_url','post_grid_layout_element_option_wck_url');
|
1120 |
+
function post_grid_layout_element_option_wck_url($parameters){
|
1121 |
+
|
1122 |
+
$settings_tabs_field = new settings_tabs_field();
|
1123 |
+
|
1124 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1125 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1126 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1127 |
+
|
1128 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
1129 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
1130 |
+
|
1131 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1132 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1133 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1134 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1135 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1136 |
+
|
1137 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1138 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1139 |
+
|
1140 |
+
|
1141 |
+
|
1142 |
+
?>
|
1143 |
+
<div class="item">
|
1144 |
+
<div class="element-title header ">
|
1145 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1146 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1147 |
+
|
1148 |
+
<span class="expand"><?php echo __('WCK URL','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
1149 |
+
</div>
|
1150 |
+
<div class="element-options options">
|
1151 |
+
|
1152 |
+
<?php
|
1153 |
+
|
1154 |
+
$args = array(
|
1155 |
+
'id' => 'wck_key',
|
1156 |
+
'css_id' => $element_index.'_text',
|
1157 |
+
'parent' => $input_name.'[wck_url]',
|
1158 |
+
'title' => __('WCK key','post-grid'),
|
1159 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
1160 |
+
'type' => 'text',
|
1161 |
+
'value' => $wck_key,
|
1162 |
+
'default' => '',
|
1163 |
+
'placeholder' => '',
|
1164 |
+
);
|
1165 |
+
|
1166 |
+
$settings_tabs_field->generate_field($args);
|
1167 |
+
|
1168 |
+
$args = array(
|
1169 |
+
'id' => 'wrapper_html',
|
1170 |
+
'css_id' => $element_index.'_wrapper_html',
|
1171 |
+
'parent' => $input_name.'[wck_url]',
|
1172 |
+
'title' => __('Wrapper html','post-grid'),
|
1173 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Link: <a href="%s">Visit link</a></code>','post-grid'),
|
1174 |
+
'type' => 'text',
|
1175 |
+
'value' => $wrapper_html,
|
1176 |
+
'default' => '',
|
1177 |
+
'placeholder' => 'Link: %s',
|
1178 |
+
);
|
1179 |
+
|
1180 |
+
$settings_tabs_field->generate_field($args);
|
1181 |
+
|
1182 |
+
|
1183 |
+
$args = array(
|
1184 |
+
'id' => 'color',
|
1185 |
+
'css_id' => $element_index.'_wck_url',
|
1186 |
+
'parent' => $input_name.'[wck_url]',
|
1187 |
+
'title' => __('Color','post-grid'),
|
1188 |
+
'details' => __('Title text color.','post-grid'),
|
1189 |
+
'type' => 'colorpicker',
|
1190 |
+
'value' => $color,
|
1191 |
+
'default' => '',
|
1192 |
+
);
|
1193 |
+
|
1194 |
+
$settings_tabs_field->generate_field($args);
|
1195 |
+
|
1196 |
+
$args = array(
|
1197 |
+
'id' => 'font_size',
|
1198 |
+
'css_id' => $element_index.'_font_size',
|
1199 |
+
'parent' => $input_name.'[wck_url]',
|
1200 |
+
'title' => __('Font size','post-grid'),
|
1201 |
+
'details' => __('Set font size.','post-grid'),
|
1202 |
+
'type' => 'text',
|
1203 |
+
'value' => $font_size,
|
1204 |
+
'default' => '',
|
1205 |
+
'placeholder' => '14px',
|
1206 |
+
);
|
1207 |
+
|
1208 |
+
$settings_tabs_field->generate_field($args);
|
1209 |
+
|
1210 |
+
|
1211 |
+
$args = array(
|
1212 |
+
'id' => 'font_family',
|
1213 |
+
'css_id' => $element_index.'_font_family',
|
1214 |
+
'parent' => $input_name.'[wck_url]',
|
1215 |
+
'title' => __('Font family','post-grid'),
|
1216 |
+
'details' => __('Set font family.','post-grid'),
|
1217 |
+
'type' => 'text',
|
1218 |
+
'value' => $font_family,
|
1219 |
+
'default' => '',
|
1220 |
+
'placeholder' => 'Open Sans',
|
1221 |
+
);
|
1222 |
+
|
1223 |
+
$settings_tabs_field->generate_field($args);
|
1224 |
+
|
1225 |
+
|
1226 |
+
$args = array(
|
1227 |
+
'id' => 'margin',
|
1228 |
+
'css_id' => $element_index.'_margin',
|
1229 |
+
'parent' => $input_name.'[wck_url]',
|
1230 |
+
'title' => __('Margin','post-grid'),
|
1231 |
+
'details' => __('Set margin.','post-grid'),
|
1232 |
+
'type' => 'text',
|
1233 |
+
'value' => $margin,
|
1234 |
+
'default' => '',
|
1235 |
+
'placeholder' => '5px 0',
|
1236 |
+
);
|
1237 |
+
|
1238 |
+
$settings_tabs_field->generate_field($args);
|
1239 |
+
|
1240 |
+
|
1241 |
+
$args = array(
|
1242 |
+
'id' => 'text_align',
|
1243 |
+
'css_id' => $element_index.'_text_align',
|
1244 |
+
'parent' => $input_name.'[wck_url]',
|
1245 |
+
'title' => __('Text align','post-grid'),
|
1246 |
+
'details' => __('Choose text align.','post-grid'),
|
1247 |
+
'type' => 'select',
|
1248 |
+
'value' => $text_align,
|
1249 |
+
'default' => 'left',
|
1250 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1251 |
+
);
|
1252 |
+
|
1253 |
+
$settings_tabs_field->generate_field($args);
|
1254 |
+
|
1255 |
+
|
1256 |
+
$args = array(
|
1257 |
+
'id' => 'css',
|
1258 |
+
'css_id' => $element_index.'_css',
|
1259 |
+
'parent' => $input_name.'[wck_url]',
|
1260 |
+
'title' => __('Custom CSS','post-grid'),
|
1261 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1262 |
+
'type' => 'textarea',
|
1263 |
+
'value' => $css,
|
1264 |
+
'default' => '',
|
1265 |
+
'placeholder' => '',
|
1266 |
+
);
|
1267 |
+
|
1268 |
+
$settings_tabs_field->generate_field($args);
|
1269 |
+
|
1270 |
+
$args = array(
|
1271 |
+
'id' => 'css_hover',
|
1272 |
+
'css_id' => $element_index.'_css_hover',
|
1273 |
+
'parent' => $input_name.'[wck_url]',
|
1274 |
+
'title' => __('Hover CSS','post-grid'),
|
1275 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1276 |
+
'type' => 'textarea',
|
1277 |
+
'value' => $css_hover,
|
1278 |
+
'default' => '',
|
1279 |
+
'placeholder' => '',
|
1280 |
+
);
|
1281 |
+
|
1282 |
+
$settings_tabs_field->generate_field($args);
|
1283 |
+
|
1284 |
+
|
1285 |
+
ob_start();
|
1286 |
+
?>
|
1287 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1288 |
+
<?php
|
1289 |
+
|
1290 |
+
$html = ob_get_clean();
|
1291 |
+
|
1292 |
+
$args = array(
|
1293 |
+
'id' => 'use_css',
|
1294 |
+
'title' => __('Use of CSS','post-grid'),
|
1295 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1296 |
+
'type' => 'custom_html',
|
1297 |
+
'html' => $html,
|
1298 |
+
|
1299 |
+
);
|
1300 |
+
|
1301 |
+
$settings_tabs_field->generate_field($args);
|
1302 |
+
|
1303 |
+
?>
|
1304 |
+
|
1305 |
+
</div>
|
1306 |
+
</div>
|
1307 |
+
<?php
|
1308 |
+
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
|
1312 |
+
|
1313 |
+
add_action('post_grid_layout_element_wck_url', 'post_grid_layout_element_wck_url');
|
1314 |
+
function post_grid_layout_element_wck_url($args){
|
1315 |
+
|
1316 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1317 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1318 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1319 |
+
|
1320 |
+
if(empty($post_id)) return;
|
1321 |
+
|
1322 |
+
$title = get_the_title($post_id);
|
1323 |
+
|
1324 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1325 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
1326 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1327 |
+
|
1328 |
+
|
1329 |
+
|
1330 |
+
//var_dump($wck_key);
|
1331 |
+
|
1332 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
1333 |
+
|
1334 |
+
|
1335 |
+
|
1336 |
+
if(!empty($wck_value)):
|
1337 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
1338 |
+
?>
|
1339 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_url ">
|
1340 |
+
<?php echo ($wck_value); ?>
|
1341 |
+
</div>
|
1342 |
+
<?php
|
1343 |
+
endif;
|
1344 |
+
|
1345 |
+
}
|
1346 |
+
|
1347 |
+
|
1348 |
+
|
1349 |
+
add_action('post_grid_layout_element_css_wck_url', 'post_grid_layout_element_css_wck_url', 10);
|
1350 |
+
function post_grid_layout_element_css_wck_url($args){
|
1351 |
+
|
1352 |
+
|
1353 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1354 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1355 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1356 |
+
|
1357 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1358 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1359 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1360 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1361 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1362 |
+
|
1363 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1364 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1365 |
+
|
1366 |
+
?>
|
1367 |
+
<style type="text/css">
|
1368 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1369 |
+
<?php if(!empty($color)): ?>
|
1370 |
+
color: <?php echo $color; ?>;
|
1371 |
+
<?php endif; ?>
|
1372 |
+
<?php if(!empty($font_size)): ?>
|
1373 |
+
font-size: <?php echo $font_size; ?>;
|
1374 |
+
<?php endif; ?>
|
1375 |
+
<?php if(!empty($font_family)): ?>
|
1376 |
+
font-family: <?php echo $font_family; ?>;
|
1377 |
+
<?php endif; ?>
|
1378 |
+
<?php if(!empty($margin)): ?>
|
1379 |
+
margin: <?php echo $margin; ?>;
|
1380 |
+
<?php endif; ?>
|
1381 |
+
<?php if(!empty($text_align)): ?>
|
1382 |
+
text-align: <?php echo $text_align; ?>;
|
1383 |
+
<?php endif; ?>
|
1384 |
+
<?php if(!empty($css)): ?>
|
1385 |
+
<?php echo $css; ?>
|
1386 |
+
<?php endif; ?>
|
1387 |
+
}
|
1388 |
+
<?php if(!empty($css_hover)): ?>
|
1389 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1390 |
+
<?php echo $css_hover; ?>
|
1391 |
+
}
|
1392 |
+
<?php endif; ?>
|
1393 |
+
</style>
|
1394 |
+
<?php
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
|
1398 |
+
add_action('post_grid_layout_element_option_wck_range','post_grid_layout_element_option_wck_range');
|
1399 |
+
function post_grid_layout_element_option_wck_range($parameters){
|
1400 |
+
|
1401 |
+
$settings_tabs_field = new settings_tabs_field();
|
1402 |
+
|
1403 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1404 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1405 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1406 |
+
|
1407 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
1408 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1409 |
+
|
1410 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1411 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1412 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1413 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1414 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1415 |
+
|
1416 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1417 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1418 |
+
|
1419 |
+
|
1420 |
+
|
1421 |
+
?>
|
1422 |
+
<div class="item">
|
1423 |
+
<div class="element-title header ">
|
1424 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1425 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1426 |
+
|
1427 |
+
<span class="expand"><?php echo __('WCK Range','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
1428 |
+
</div>
|
1429 |
+
<div class="element-options options">
|
1430 |
+
|
1431 |
+
<?php
|
1432 |
+
|
1433 |
+
$args = array(
|
1434 |
+
'id' => 'wck_key',
|
1435 |
+
'css_id' => $element_index.'_text',
|
1436 |
+
'parent' => $input_name.'[wck_range]',
|
1437 |
+
'title' => __('WCK key','post-grid'),
|
1438 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
1439 |
+
'type' => 'text',
|
1440 |
+
'value' => $wck_key,
|
1441 |
+
'default' => '',
|
1442 |
+
'placeholder' => '',
|
1443 |
+
);
|
1444 |
+
|
1445 |
+
$settings_tabs_field->generate_field($args);
|
1446 |
+
|
1447 |
+
$args = array(
|
1448 |
+
'id' => 'wrapper_html',
|
1449 |
+
'css_id' => $element_index.'_wrapper_html',
|
1450 |
+
'parent' => $input_name.'[wck_range]',
|
1451 |
+
'title' => __('Wrapper html','post-grid'),
|
1452 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>value: %s</code>','post-grid'),
|
1453 |
+
'type' => 'text',
|
1454 |
+
'value' => $wrapper_html,
|
1455 |
+
'default' => '',
|
1456 |
+
'placeholder' => 'Value: %s',
|
1457 |
+
);
|
1458 |
+
|
1459 |
+
$settings_tabs_field->generate_field($args);
|
1460 |
+
|
1461 |
+
|
1462 |
+
$args = array(
|
1463 |
+
'id' => 'color',
|
1464 |
+
'css_id' => $element_index.'_wck_range',
|
1465 |
+
'parent' => $input_name.'[wck_range]',
|
1466 |
+
'title' => __('Color','post-grid'),
|
1467 |
+
'details' => __('Title text color.','post-grid'),
|
1468 |
+
'type' => 'colorpicker',
|
1469 |
+
'value' => $color,
|
1470 |
+
'default' => '',
|
1471 |
+
);
|
1472 |
+
|
1473 |
+
$settings_tabs_field->generate_field($args);
|
1474 |
+
|
1475 |
+
$args = array(
|
1476 |
+
'id' => 'font_size',
|
1477 |
+
'css_id' => $element_index.'_font_size',
|
1478 |
+
'parent' => $input_name.'[wck_range]',
|
1479 |
+
'title' => __('Font size','post-grid'),
|
1480 |
+
'details' => __('Set font size.','post-grid'),
|
1481 |
+
'type' => 'text',
|
1482 |
+
'value' => $font_size,
|
1483 |
+
'default' => '',
|
1484 |
+
'placeholder' => '14px',
|
1485 |
+
);
|
1486 |
+
|
1487 |
+
$settings_tabs_field->generate_field($args);
|
1488 |
+
|
1489 |
+
|
1490 |
+
$args = array(
|
1491 |
+
'id' => 'font_family',
|
1492 |
+
'css_id' => $element_index.'_font_family',
|
1493 |
+
'parent' => $input_name.'[wck_range]',
|
1494 |
+
'title' => __('Font family','post-grid'),
|
1495 |
+
'details' => __('Set font family.','post-grid'),
|
1496 |
+
'type' => 'text',
|
1497 |
+
'value' => $font_family,
|
1498 |
+
'default' => '',
|
1499 |
+
'placeholder' => 'Open Sans',
|
1500 |
+
);
|
1501 |
+
|
1502 |
+
$settings_tabs_field->generate_field($args);
|
1503 |
+
|
1504 |
+
|
1505 |
+
$args = array(
|
1506 |
+
'id' => 'margin',
|
1507 |
+
'css_id' => $element_index.'_margin',
|
1508 |
+
'parent' => $input_name.'[wck_range]',
|
1509 |
+
'title' => __('Margin','post-grid'),
|
1510 |
+
'details' => __('Set margin.','post-grid'),
|
1511 |
+
'type' => 'text',
|
1512 |
+
'value' => $margin,
|
1513 |
+
'default' => '',
|
1514 |
+
'placeholder' => '5px 0',
|
1515 |
+
);
|
1516 |
+
|
1517 |
+
$settings_tabs_field->generate_field($args);
|
1518 |
+
|
1519 |
+
|
1520 |
+
$args = array(
|
1521 |
+
'id' => 'text_align',
|
1522 |
+
'css_id' => $element_index.'_text_align',
|
1523 |
+
'parent' => $input_name.'[wck_range]',
|
1524 |
+
'title' => __('Text align','post-grid'),
|
1525 |
+
'details' => __('Choose text align.','post-grid'),
|
1526 |
+
'type' => 'select',
|
1527 |
+
'value' => $text_align,
|
1528 |
+
'default' => 'left',
|
1529 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1530 |
+
);
|
1531 |
+
|
1532 |
+
$settings_tabs_field->generate_field($args);
|
1533 |
+
|
1534 |
+
|
1535 |
+
$args = array(
|
1536 |
+
'id' => 'css',
|
1537 |
+
'css_id' => $element_index.'_css',
|
1538 |
+
'parent' => $input_name.'[wck_range]',
|
1539 |
+
'title' => __('Custom CSS','post-grid'),
|
1540 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1541 |
+
'type' => 'textarea',
|
1542 |
+
'value' => $css,
|
1543 |
+
'default' => '',
|
1544 |
+
'placeholder' => '',
|
1545 |
+
);
|
1546 |
+
|
1547 |
+
$settings_tabs_field->generate_field($args);
|
1548 |
+
|
1549 |
+
$args = array(
|
1550 |
+
'id' => 'css_hover',
|
1551 |
+
'css_id' => $element_index.'_css_hover',
|
1552 |
+
'parent' => $input_name.'[wck_range]',
|
1553 |
+
'title' => __('Hover CSS','post-grid'),
|
1554 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1555 |
+
'type' => 'textarea',
|
1556 |
+
'value' => $css_hover,
|
1557 |
+
'default' => '',
|
1558 |
+
'placeholder' => '',
|
1559 |
+
);
|
1560 |
+
|
1561 |
+
$settings_tabs_field->generate_field($args);
|
1562 |
+
|
1563 |
+
|
1564 |
+
ob_start();
|
1565 |
+
?>
|
1566 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1567 |
+
<?php
|
1568 |
+
|
1569 |
+
$html = ob_get_clean();
|
1570 |
+
|
1571 |
+
$args = array(
|
1572 |
+
'id' => 'use_css',
|
1573 |
+
'title' => __('Use of CSS','post-grid'),
|
1574 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1575 |
+
'type' => 'custom_html',
|
1576 |
+
'html' => $html,
|
1577 |
+
|
1578 |
+
);
|
1579 |
+
|
1580 |
+
$settings_tabs_field->generate_field($args);
|
1581 |
+
|
1582 |
+
?>
|
1583 |
+
|
1584 |
+
</div>
|
1585 |
+
</div>
|
1586 |
+
<?php
|
1587 |
+
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
|
1591 |
+
|
1592 |
+
add_action('post_grid_layout_element_wck_range', 'post_grid_layout_element_wck_range');
|
1593 |
+
function post_grid_layout_element_wck_range($args){
|
1594 |
+
|
1595 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1596 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1597 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1598 |
+
|
1599 |
+
if(empty($post_id)) return;
|
1600 |
+
|
1601 |
+
$title = get_the_title($post_id);
|
1602 |
+
|
1603 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1604 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
1605 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1606 |
+
|
1607 |
+
|
1608 |
+
|
1609 |
+
//var_dump($wck_key);
|
1610 |
+
|
1611 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
1612 |
+
|
1613 |
+
if(!empty($wck_value)):
|
1614 |
+
|
1615 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
1616 |
+
|
1617 |
+
?>
|
1618 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_range ">
|
1619 |
+
<?php echo esc_html($wck_value); ?>
|
1620 |
+
</div>
|
1621 |
+
<?php
|
1622 |
+
endif;
|
1623 |
+
|
1624 |
+
}
|
1625 |
+
|
1626 |
+
|
1627 |
+
|
1628 |
+
add_action('post_grid_layout_element_css_wck_range', 'post_grid_layout_element_css_wck_range', 10);
|
1629 |
+
function post_grid_layout_element_css_wck_range($args){
|
1630 |
+
|
1631 |
+
|
1632 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1633 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1634 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1635 |
+
|
1636 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1637 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1638 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1639 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1640 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1641 |
+
|
1642 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1643 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1644 |
+
|
1645 |
+
?>
|
1646 |
+
<style type="text/css">
|
1647 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1648 |
+
<?php if(!empty($color)): ?>
|
1649 |
+
color: <?php echo $color; ?>;
|
1650 |
+
<?php endif; ?>
|
1651 |
+
<?php if(!empty($font_size)): ?>
|
1652 |
+
font-size: <?php echo $font_size; ?>;
|
1653 |
+
<?php endif; ?>
|
1654 |
+
<?php if(!empty($font_family)): ?>
|
1655 |
+
font-family: <?php echo $font_family; ?>;
|
1656 |
+
<?php endif; ?>
|
1657 |
+
<?php if(!empty($margin)): ?>
|
1658 |
+
margin: <?php echo $margin; ?>;
|
1659 |
+
<?php endif; ?>
|
1660 |
+
<?php if(!empty($text_align)): ?>
|
1661 |
+
text-align: <?php echo $text_align; ?>;
|
1662 |
+
<?php endif; ?>
|
1663 |
+
<?php if(!empty($css)): ?>
|
1664 |
+
<?php echo $css; ?>
|
1665 |
+
<?php endif; ?>
|
1666 |
+
}
|
1667 |
+
<?php if(!empty($css_hover)): ?>
|
1668 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1669 |
+
<?php echo $css_hover; ?>
|
1670 |
+
}
|
1671 |
+
<?php endif; ?>
|
1672 |
+
</style>
|
1673 |
+
<?php
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
|
1677 |
+
|
1678 |
+
add_action('post_grid_layout_element_option_wck_wysiwyg','post_grid_layout_element_option_wck_wysiwyg');
|
1679 |
+
function post_grid_layout_element_option_wck_wysiwyg($parameters){
|
1680 |
+
|
1681 |
+
$settings_tabs_field = new settings_tabs_field();
|
1682 |
+
|
1683 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1684 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1685 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1686 |
+
|
1687 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
1688 |
+
|
1689 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1690 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1691 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1692 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1693 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1694 |
+
|
1695 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1696 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1697 |
+
|
1698 |
+
|
1699 |
+
|
1700 |
+
?>
|
1701 |
+
<div class="item">
|
1702 |
+
<div class="element-title header ">
|
1703 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1704 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1705 |
+
|
1706 |
+
<span class="expand"><?php echo __('WCK Wysiwyg','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
1707 |
+
</div>
|
1708 |
+
<div class="element-options options">
|
1709 |
+
|
1710 |
+
<?php
|
1711 |
+
|
1712 |
+
$args = array(
|
1713 |
+
'id' => 'wck_key',
|
1714 |
+
'css_id' => $element_index.'_text',
|
1715 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1716 |
+
'title' => __('WCK key','post-grid'),
|
1717 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
1718 |
+
'type' => 'text',
|
1719 |
+
'value' => $wck_key,
|
1720 |
+
'default' => '',
|
1721 |
+
'placeholder' => '',
|
1722 |
+
);
|
1723 |
+
|
1724 |
+
$settings_tabs_field->generate_field($args);
|
1725 |
+
|
1726 |
+
$args = array(
|
1727 |
+
'id' => 'color',
|
1728 |
+
'css_id' => $element_index.'_wck_wysiwyg',
|
1729 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1730 |
+
'title' => __('Color','post-grid'),
|
1731 |
+
'details' => __('Title text color.','post-grid'),
|
1732 |
+
'type' => 'colorpicker',
|
1733 |
+
'value' => $color,
|
1734 |
+
'default' => '',
|
1735 |
+
);
|
1736 |
+
|
1737 |
+
$settings_tabs_field->generate_field($args);
|
1738 |
+
|
1739 |
+
$args = array(
|
1740 |
+
'id' => 'font_size',
|
1741 |
+
'css_id' => $element_index.'_font_size',
|
1742 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1743 |
+
'title' => __('Font size','post-grid'),
|
1744 |
+
'details' => __('Set font size.','post-grid'),
|
1745 |
+
'type' => 'text',
|
1746 |
+
'value' => $font_size,
|
1747 |
+
'default' => '',
|
1748 |
+
'placeholder' => '14px',
|
1749 |
+
);
|
1750 |
+
|
1751 |
+
$settings_tabs_field->generate_field($args);
|
1752 |
+
|
1753 |
+
|
1754 |
+
$args = array(
|
1755 |
+
'id' => 'font_family',
|
1756 |
+
'css_id' => $element_index.'_font_family',
|
1757 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1758 |
+
'title' => __('Font family','post-grid'),
|
1759 |
+
'details' => __('Set font family.','post-grid'),
|
1760 |
+
'type' => 'text',
|
1761 |
+
'value' => $font_family,
|
1762 |
+
'default' => '',
|
1763 |
+
'placeholder' => 'Open Sans',
|
1764 |
+
);
|
1765 |
+
|
1766 |
+
$settings_tabs_field->generate_field($args);
|
1767 |
+
|
1768 |
+
|
1769 |
+
$args = array(
|
1770 |
+
'id' => 'margin',
|
1771 |
+
'css_id' => $element_index.'_margin',
|
1772 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1773 |
+
'title' => __('Margin','post-grid'),
|
1774 |
+
'details' => __('Set margin.','post-grid'),
|
1775 |
+
'type' => 'text',
|
1776 |
+
'value' => $margin,
|
1777 |
+
'default' => '',
|
1778 |
+
'placeholder' => '5px 0',
|
1779 |
+
);
|
1780 |
+
|
1781 |
+
$settings_tabs_field->generate_field($args);
|
1782 |
+
|
1783 |
+
|
1784 |
+
$args = array(
|
1785 |
+
'id' => 'text_align',
|
1786 |
+
'css_id' => $element_index.'_text_align',
|
1787 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1788 |
+
'title' => __('Text align','post-grid'),
|
1789 |
+
'details' => __('Choose text align.','post-grid'),
|
1790 |
+
'type' => 'select',
|
1791 |
+
'value' => $text_align,
|
1792 |
+
'default' => 'left',
|
1793 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1794 |
+
);
|
1795 |
+
|
1796 |
+
$settings_tabs_field->generate_field($args);
|
1797 |
+
|
1798 |
+
|
1799 |
+
$args = array(
|
1800 |
+
'id' => 'css',
|
1801 |
+
'css_id' => $element_index.'_css',
|
1802 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1803 |
+
'title' => __('Custom CSS','post-grid'),
|
1804 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1805 |
+
'type' => 'textarea',
|
1806 |
+
'value' => $css,
|
1807 |
+
'default' => '',
|
1808 |
+
'placeholder' => '',
|
1809 |
+
);
|
1810 |
+
|
1811 |
+
$settings_tabs_field->generate_field($args);
|
1812 |
+
|
1813 |
+
$args = array(
|
1814 |
+
'id' => 'css_hover',
|
1815 |
+
'css_id' => $element_index.'_css_hover',
|
1816 |
+
'parent' => $input_name.'[wck_wysiwyg]',
|
1817 |
+
'title' => __('Hover CSS','post-grid'),
|
1818 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1819 |
+
'type' => 'textarea',
|
1820 |
+
'value' => $css_hover,
|
1821 |
+
'default' => '',
|
1822 |
+
'placeholder' => '',
|
1823 |
+
);
|
1824 |
+
|
1825 |
+
$settings_tabs_field->generate_field($args);
|
1826 |
+
|
1827 |
+
|
1828 |
+
ob_start();
|
1829 |
+
?>
|
1830 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1831 |
+
<?php
|
1832 |
+
|
1833 |
+
$html = ob_get_clean();
|
1834 |
+
|
1835 |
+
$args = array(
|
1836 |
+
'id' => 'use_css',
|
1837 |
+
'title' => __('Use of CSS','post-grid'),
|
1838 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1839 |
+
'type' => 'custom_html',
|
1840 |
+
'html' => $html,
|
1841 |
+
|
1842 |
+
);
|
1843 |
+
|
1844 |
+
$settings_tabs_field->generate_field($args);
|
1845 |
+
|
1846 |
+
?>
|
1847 |
+
|
1848 |
+
</div>
|
1849 |
+
</div>
|
1850 |
+
<?php
|
1851 |
+
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
|
1855 |
+
|
1856 |
+
add_action('post_grid_layout_element_wck_wysiwyg', 'post_grid_layout_element_wck_wysiwyg');
|
1857 |
+
function post_grid_layout_element_wck_wysiwyg($args){
|
1858 |
+
|
1859 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1860 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1861 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1862 |
+
|
1863 |
+
if(empty($post_id)) return;
|
1864 |
+
|
1865 |
+
$title = get_the_title($post_id);
|
1866 |
+
|
1867 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1868 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
1869 |
+
|
1870 |
+
|
1871 |
+
|
1872 |
+
|
1873 |
+
|
1874 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
1875 |
+
|
1876 |
+
//var_dump($wck_value);
|
1877 |
+
|
1878 |
+
if(!empty($wck_value)):
|
1879 |
+
|
1880 |
+
?>
|
1881 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_wysiwyg ">
|
1882 |
+
<?php echo ($wck_value); ?>
|
1883 |
+
</div>
|
1884 |
+
<?php
|
1885 |
+
endif;
|
1886 |
+
|
1887 |
+
}
|
1888 |
+
|
1889 |
+
|
1890 |
+
|
1891 |
+
add_action('post_grid_layout_element_css_wck_wysiwyg', 'post_grid_layout_element_css_wck_wysiwyg', 10);
|
1892 |
+
function post_grid_layout_element_css_wck_wysiwyg($args){
|
1893 |
+
|
1894 |
+
|
1895 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1896 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1897 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1898 |
+
|
1899 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1900 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1901 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1902 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1903 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1904 |
+
|
1905 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1906 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1907 |
+
|
1908 |
+
?>
|
1909 |
+
<style type="text/css">
|
1910 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1911 |
+
<?php if(!empty($color)): ?>
|
1912 |
+
color: <?php echo $color; ?>;
|
1913 |
+
<?php endif; ?>
|
1914 |
+
<?php if(!empty($font_size)): ?>
|
1915 |
+
font-size: <?php echo $font_size; ?>;
|
1916 |
+
<?php endif; ?>
|
1917 |
+
<?php if(!empty($font_family)): ?>
|
1918 |
+
font-family: <?php echo $font_family; ?>;
|
1919 |
+
<?php endif; ?>
|
1920 |
+
<?php if(!empty($margin)): ?>
|
1921 |
+
margin: <?php echo $margin; ?>;
|
1922 |
+
<?php endif; ?>
|
1923 |
+
<?php if(!empty($text_align)): ?>
|
1924 |
+
text-align: <?php echo $text_align; ?>;
|
1925 |
+
<?php endif; ?>
|
1926 |
+
<?php if(!empty($css)): ?>
|
1927 |
+
<?php echo $css; ?>
|
1928 |
+
<?php endif; ?>
|
1929 |
+
}
|
1930 |
+
<?php if(!empty($css_hover)): ?>
|
1931 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1932 |
+
<?php echo $css_hover; ?>
|
1933 |
+
}
|
1934 |
+
<?php endif; ?>
|
1935 |
+
</style>
|
1936 |
+
<?php
|
1937 |
+
}
|
1938 |
+
|
1939 |
+
|
1940 |
+
add_action('post_grid_layout_element_option_wck_upload','post_grid_layout_element_option_wck_upload');
|
1941 |
+
function post_grid_layout_element_option_wck_upload($parameters){
|
1942 |
+
|
1943 |
+
$settings_tabs_field = new settings_tabs_field();
|
1944 |
+
|
1945 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1946 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1947 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1948 |
+
|
1949 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
1950 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1951 |
+
|
1952 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1953 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1954 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1955 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1956 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1957 |
+
|
1958 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1959 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1960 |
+
|
1961 |
+
|
1962 |
+
|
1963 |
+
?>
|
1964 |
+
<div class="item">
|
1965 |
+
<div class="element-title header ">
|
1966 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1967 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1968 |
+
|
1969 |
+
<span class="expand"><?php echo __('WCK Image','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
1970 |
+
</div>
|
1971 |
+
<div class="element-options options">
|
1972 |
+
|
1973 |
+
<?php
|
1974 |
+
|
1975 |
+
$args = array(
|
1976 |
+
'id' => 'wck_key',
|
1977 |
+
'css_id' => $element_index.'_text',
|
1978 |
+
'parent' => $input_name.'[wck_upload]',
|
1979 |
+
'title' => __('WCK key','post-grid'),
|
1980 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
1981 |
+
'type' => 'text',
|
1982 |
+
'value' => $wck_key,
|
1983 |
+
'default' => '',
|
1984 |
+
'placeholder' => '',
|
1985 |
+
);
|
1986 |
+
|
1987 |
+
$settings_tabs_field->generate_field($args);
|
1988 |
+
|
1989 |
+
$args = array(
|
1990 |
+
'id' => 'wrapper_html',
|
1991 |
+
'css_id' => $element_index.'_wrapper_html',
|
1992 |
+
'parent' => $input_name.'[wck_upload]',
|
1993 |
+
'title' => __('Wrapper html','post-grid'),
|
1994 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>,<br> Return type: File URL<br> <code>File: <a href="%s">Click to Download</a> </code> <br> Return type: File ID<br> <code>File id: %s</code> <br> Return type: File Array<br> <code>Link HTML: <a href="{url}">{filename}</a> </code> <br> <code>Image HTML: <img src="{url}"/> </code> <br>Parameter<br> <code>{ID}, {id}, {title}, {filename}, {filesize}, {url}, {link}, {alt}, {author}, {description}, {caption}, {name}, {date}, {mime_type}, {icon},{width}, {height} </code> <br>Sizes parameter:<br> <code>{sizes_$id} => {sizes_thumbnail}</code><br><code> {sizes_$id-width} => {sizes_thumbnail-width}</code><br><code> {sizes_$id-height} => {sizes_thumbnail-height}</code>','post-grid'),
|
1995 |
+
'type' => 'text',
|
1996 |
+
'value' => $wrapper_html,
|
1997 |
+
'default' => '',
|
1998 |
+
'placeholder' => 'Image: %s',
|
1999 |
+
);
|
2000 |
+
|
2001 |
+
$settings_tabs_field->generate_field($args);
|
2002 |
+
|
2003 |
+
$args = array(
|
2004 |
+
'id' => 'color',
|
2005 |
+
'css_id' => $element_index.'_wck_upload',
|
2006 |
+
'parent' => $input_name.'[wck_upload]',
|
2007 |
+
'title' => __('Color','post-grid'),
|
2008 |
+
'details' => __('Title text color.','post-grid'),
|
2009 |
+
'type' => 'colorpicker',
|
2010 |
+
'value' => $color,
|
2011 |
+
'default' => '',
|
2012 |
+
);
|
2013 |
+
|
2014 |
+
$settings_tabs_field->generate_field($args);
|
2015 |
+
|
2016 |
+
$args = array(
|
2017 |
+
'id' => 'font_size',
|
2018 |
+
'css_id' => $element_index.'_font_size',
|
2019 |
+
'parent' => $input_name.'[wck_upload]',
|
2020 |
+
'title' => __('Font size','post-grid'),
|
2021 |
+
'details' => __('Set font size.','post-grid'),
|
2022 |
+
'type' => 'text',
|
2023 |
+
'value' => $font_size,
|
2024 |
+
'default' => '',
|
2025 |
+
'placeholder' => '14px',
|
2026 |
+
);
|
2027 |
+
|
2028 |
+
$settings_tabs_field->generate_field($args);
|
2029 |
+
|
2030 |
+
|
2031 |
+
$args = array(
|
2032 |
+
'id' => 'font_family',
|
2033 |
+
'css_id' => $element_index.'_font_family',
|
2034 |
+
'parent' => $input_name.'[wck_upload]',
|
2035 |
+
'title' => __('Font family','post-grid'),
|
2036 |
+
'details' => __('Set font family.','post-grid'),
|
2037 |
+
'type' => 'text',
|
2038 |
+
'value' => $font_family,
|
2039 |
+
'default' => '',
|
2040 |
+
'placeholder' => 'Open Sans',
|
2041 |
+
);
|
2042 |
+
|
2043 |
+
$settings_tabs_field->generate_field($args);
|
2044 |
+
|
2045 |
+
|
2046 |
+
$args = array(
|
2047 |
+
'id' => 'margin',
|
2048 |
+
'css_id' => $element_index.'_margin',
|
2049 |
+
'parent' => $input_name.'[wck_upload]',
|
2050 |
+
'title' => __('Margin','post-grid'),
|
2051 |
+
'details' => __('Set margin.','post-grid'),
|
2052 |
+
'type' => 'text',
|
2053 |
+
'value' => $margin,
|
2054 |
+
'default' => '',
|
2055 |
+
'placeholder' => '5px 0',
|
2056 |
+
);
|
2057 |
+
|
2058 |
+
$settings_tabs_field->generate_field($args);
|
2059 |
+
|
2060 |
+
|
2061 |
+
$args = array(
|
2062 |
+
'id' => 'text_align',
|
2063 |
+
'css_id' => $element_index.'_text_align',
|
2064 |
+
'parent' => $input_name.'[wck_upload]',
|
2065 |
+
'title' => __('Text align','post-grid'),
|
2066 |
+
'details' => __('Choose text align.','post-grid'),
|
2067 |
+
'type' => 'select',
|
2068 |
+
'value' => $text_align,
|
2069 |
+
'default' => 'left',
|
2070 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
2071 |
+
);
|
2072 |
+
|
2073 |
+
$settings_tabs_field->generate_field($args);
|
2074 |
+
|
2075 |
+
|
2076 |
+
$args = array(
|
2077 |
+
'id' => 'css',
|
2078 |
+
'css_id' => $element_index.'_css',
|
2079 |
+
'parent' => $input_name.'[wck_upload]',
|
2080 |
+
'title' => __('Custom CSS','post-grid'),
|
2081 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
2082 |
+
'type' => 'textarea',
|
2083 |
+
'value' => $css,
|
2084 |
+
'default' => '',
|
2085 |
+
'placeholder' => '',
|
2086 |
+
);
|
2087 |
+
|
2088 |
+
$settings_tabs_field->generate_field($args);
|
2089 |
+
|
2090 |
+
$args = array(
|
2091 |
+
'id' => 'css_hover',
|
2092 |
+
'css_id' => $element_index.'_css_hover',
|
2093 |
+
'parent' => $input_name.'[wck_upload]',
|
2094 |
+
'title' => __('Hover CSS','post-grid'),
|
2095 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
2096 |
+
'type' => 'textarea',
|
2097 |
+
'value' => $css_hover,
|
2098 |
+
'default' => '',
|
2099 |
+
'placeholder' => '',
|
2100 |
+
);
|
2101 |
+
|
2102 |
+
$settings_tabs_field->generate_field($args);
|
2103 |
+
|
2104 |
+
|
2105 |
+
ob_start();
|
2106 |
+
?>
|
2107 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
2108 |
+
<?php
|
2109 |
+
|
2110 |
+
$html = ob_get_clean();
|
2111 |
+
|
2112 |
+
$args = array(
|
2113 |
+
'id' => 'use_css',
|
2114 |
+
'title' => __('Use of CSS','post-grid'),
|
2115 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
2116 |
+
'type' => 'custom_html',
|
2117 |
+
'html' => $html,
|
2118 |
+
|
2119 |
+
);
|
2120 |
+
|
2121 |
+
$settings_tabs_field->generate_field($args);
|
2122 |
+
|
2123 |
+
?>
|
2124 |
+
|
2125 |
+
</div>
|
2126 |
+
</div>
|
2127 |
+
<?php
|
2128 |
+
|
2129 |
+
}
|
2130 |
+
|
2131 |
+
|
2132 |
+
|
2133 |
+
add_action('post_grid_layout_element_wck_upload', 'post_grid_layout_element_wck_upload');
|
2134 |
+
function post_grid_layout_element_wck_upload($args){
|
2135 |
+
|
2136 |
+
|
2137 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2138 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2139 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2140 |
+
|
2141 |
+
if(empty($post_id)) return;
|
2142 |
+
|
2143 |
+
$title = get_the_title($post_id);
|
2144 |
+
|
2145 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2146 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
2147 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
2148 |
+
|
2149 |
+
|
2150 |
+
|
2151 |
+
//var_dump($wck_value);
|
2152 |
+
|
2153 |
+
$attachment_id = get_post_meta($post_id, $wck_key, true );
|
2154 |
+
|
2155 |
+
|
2156 |
+
|
2157 |
+
|
2158 |
+
if(!empty($attachment_id)):
|
2159 |
+
|
2160 |
+
$wck_value = wp_get_attachment_metadata($attachment_id);
|
2161 |
+
|
2162 |
+
//echo '<pre>'.var_export($wck_value, true).'</pre>';
|
2163 |
+
|
2164 |
+
if(is_array($wck_value)){
|
2165 |
+
|
2166 |
+
|
2167 |
+
$sizes = isset($wck_value['sizes']) ? $wck_value['sizes'] : array();
|
2168 |
+
$sizes_arr = array();
|
2169 |
+
foreach ($sizes as $sizeIndex => $size){
|
2170 |
+
$sizes_arr['{sizes_'.$sizeIndex.'}'] = $size;
|
2171 |
+
}
|
2172 |
+
|
2173 |
+
//echo '<pre>'.var_export($sizes, true).'</pre>';
|
2174 |
+
|
2175 |
+
|
2176 |
+
$vars = array(
|
2177 |
+
'{ID}'=> $attachment_id,
|
2178 |
+
'{id}'=> $attachment_id,
|
2179 |
+
'{title}'=> isset($wck_value['title']) ?$wck_value['title'] : '',
|
2180 |
+
'{filename}'=> isset($wck_value['filename']) ?$wck_value['filename'] : '',
|
2181 |
+
'{filesize}'=> isset($wck_value['filesize']) ? number_format($wck_value['filesize']/1008, 2).'KB' : '',
|
2182 |
+
'{url}'=> wp_get_attachment_image_url($attachment_id),
|
2183 |
+
'{link}'=> isset($wck_value['link']) ?$wck_value['link'] : '',
|
2184 |
+
'{alt}'=> isset($wck_value['alt']) ?$wck_value['alt'] : '',
|
2185 |
+
'{author}'=> isset($wck_value['author']) ?$wck_value['author'] : '',
|
2186 |
+
'{description}'=> isset($wck_value['description']) ?$wck_value['description'] : '',
|
2187 |
+
'{caption}'=> isset($wck_value['caption']) ?$wck_value['caption'] : '',
|
2188 |
+
'{name}'=> isset($wck_value['name']) ?$wck_value['name'] : '',
|
2189 |
+
'{date}'=> isset($wck_value['date']) ?$wck_value['date'] : '',
|
2190 |
+
'{mime_type}'=> isset($wck_value['mime_type']) ?$wck_value['mime_type'] : '',
|
2191 |
+
'{icon}'=> isset($wck_value['icon']) ?$wck_value['icon'] : '',
|
2192 |
+
'{width}'=> isset($wck_value['width']) ?$wck_value['width'] : '',
|
2193 |
+
'{height}'=> isset($wck_value['height']) ?$wck_value['height'] : '',
|
2194 |
+
);
|
2195 |
+
|
2196 |
+
$vars = array_merge($vars, $sizes_arr);
|
2197 |
+
|
2198 |
+
//echo '<pre style="text-align: left">'.var_export($vars, true).'</pre>';
|
2199 |
+
|
2200 |
+
$wck_value = strtr($wrapper_html, $vars);
|
2201 |
+
|
2202 |
+
|
2203 |
+
}else{
|
2204 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
2205 |
+
}
|
2206 |
+
|
2207 |
+
|
2208 |
+
?>
|
2209 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_file ">
|
2210 |
+
<?php echo ($wck_value); ?>
|
2211 |
+
</div>
|
2212 |
+
<?php
|
2213 |
+
endif;
|
2214 |
+
|
2215 |
+
}
|
2216 |
+
|
2217 |
+
|
2218 |
+
|
2219 |
+
add_action('post_grid_layout_element_css_wck_upload', 'post_grid_layout_element_css_wck_upload', 10);
|
2220 |
+
function post_grid_layout_element_css_wck_upload($args){
|
2221 |
+
|
2222 |
+
|
2223 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2224 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2225 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2226 |
+
|
2227 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2228 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2229 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2230 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2231 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2232 |
+
|
2233 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2234 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2235 |
+
|
2236 |
+
?>
|
2237 |
+
<style type="text/css">
|
2238 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2239 |
+
<?php if(!empty($color)): ?>
|
2240 |
+
color: <?php echo $color; ?>;
|
2241 |
+
<?php endif; ?>
|
2242 |
+
<?php if(!empty($font_size)): ?>
|
2243 |
+
font-size: <?php echo $font_size; ?>;
|
2244 |
+
<?php endif; ?>
|
2245 |
+
<?php if(!empty($font_family)): ?>
|
2246 |
+
font-family: <?php echo $font_family; ?>;
|
2247 |
+
<?php endif; ?>
|
2248 |
+
<?php if(!empty($margin)): ?>
|
2249 |
+
margin: <?php echo $margin; ?>;
|
2250 |
+
<?php endif; ?>
|
2251 |
+
<?php if(!empty($text_align)): ?>
|
2252 |
+
text-align: <?php echo $text_align; ?>;
|
2253 |
+
<?php endif; ?>
|
2254 |
+
<?php if(!empty($css)): ?>
|
2255 |
+
<?php echo $css; ?>
|
2256 |
+
<?php endif; ?>
|
2257 |
+
}
|
2258 |
+
<?php if(!empty($css_hover)): ?>
|
2259 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2260 |
+
<?php echo $css_hover; ?>
|
2261 |
+
}
|
2262 |
+
<?php endif; ?>
|
2263 |
+
</style>
|
2264 |
+
<?php
|
2265 |
+
}
|
2266 |
+
|
2267 |
+
|
2268 |
+
add_action('post_grid_layout_element_option_wck_file','post_grid_layout_element_option_wck_file');
|
2269 |
+
function post_grid_layout_element_option_wck_file($parameters){
|
2270 |
+
|
2271 |
+
$settings_tabs_field = new settings_tabs_field();
|
2272 |
+
|
2273 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2274 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2275 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2276 |
+
|
2277 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
2278 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
2279 |
+
|
2280 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2281 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2282 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2283 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2284 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2285 |
+
|
2286 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
2287 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
2288 |
+
|
2289 |
+
|
2290 |
+
|
2291 |
+
?>
|
2292 |
+
<div class="item">
|
2293 |
+
<div class="element-title header ">
|
2294 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2295 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2296 |
+
|
2297 |
+
<span class="expand"><?php echo __('WCK File','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
2298 |
+
</div>
|
2299 |
+
<div class="element-options options">
|
2300 |
+
|
2301 |
+
<?php
|
2302 |
+
|
2303 |
+
$args = array(
|
2304 |
+
'id' => 'wck_key',
|
2305 |
+
'css_id' => $element_index.'_text',
|
2306 |
+
'parent' => $input_name.'[wck_file]',
|
2307 |
+
'title' => __('WCK key','post-grid'),
|
2308 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
2309 |
+
'type' => 'text',
|
2310 |
+
'value' => $wck_key,
|
2311 |
+
'default' => '',
|
2312 |
+
'placeholder' => '',
|
2313 |
+
);
|
2314 |
+
|
2315 |
+
$settings_tabs_field->generate_field($args);
|
2316 |
+
|
2317 |
+
$args = array(
|
2318 |
+
'id' => 'wrapper_html',
|
2319 |
+
'css_id' => $element_index.'_wrapper_html',
|
2320 |
+
'parent' => $input_name.'[wck_file]',
|
2321 |
+
'title' => __('Wrapper html','post-grid'),
|
2322 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>,<br> Return type: File URL<br> <code>File: <a href="%s">Click to Download</a> </code> <br> Return type: File ID<br> <code>File id: %s</code> <br> Return type: File Array<br> <code>Link HTML: <a href="{url}">{filename}</a> </code> <br> <code>Image HTML: <img src="{url}"/> </code> <br>Parameter<br> <code>{ID}, {id}, {title}, {filename}, {filesize}, {url}, {link}, {alt}, {author}, {description}, {caption}, {name}, {date}, {mime_type}, {icon},{width}, {height} </code> <br>Sizes parameter:<br> <code>{sizes_$id} => {sizes_thumbnail}</code><br><code> {sizes_$id-width} => {sizes_thumbnail-width}</code><br><code> {sizes_$id-height} => {sizes_thumbnail-height}</code>','post-grid'),
|
2323 |
+
'type' => 'text',
|
2324 |
+
'value' => $wrapper_html,
|
2325 |
+
'default' => '',
|
2326 |
+
'placeholder' => 'Value: %s',
|
2327 |
+
);
|
2328 |
+
|
2329 |
+
$settings_tabs_field->generate_field($args);
|
2330 |
+
|
2331 |
+
|
2332 |
+
$args = array(
|
2333 |
+
'id' => 'color',
|
2334 |
+
'css_id' => $element_index.'_wck_file',
|
2335 |
+
'parent' => $input_name.'[wck_file]',
|
2336 |
+
'title' => __('Color','post-grid'),
|
2337 |
+
'details' => __('Title text color.','post-grid'),
|
2338 |
+
'type' => 'colorpicker',
|
2339 |
+
'value' => $color,
|
2340 |
+
'default' => '',
|
2341 |
+
);
|
2342 |
+
|
2343 |
+
$settings_tabs_field->generate_field($args);
|
2344 |
+
|
2345 |
+
$args = array(
|
2346 |
+
'id' => 'font_size',
|
2347 |
+
'css_id' => $element_index.'_font_size',
|
2348 |
+
'parent' => $input_name.'[wck_file]',
|
2349 |
+
'title' => __('Font size','post-grid'),
|
2350 |
+
'details' => __('Set font size.','post-grid'),
|
2351 |
+
'type' => 'text',
|
2352 |
+
'value' => $font_size,
|
2353 |
+
'default' => '',
|
2354 |
+
'placeholder' => '14px',
|
2355 |
+
);
|
2356 |
+
|
2357 |
+
$settings_tabs_field->generate_field($args);
|
2358 |
+
|
2359 |
+
|
2360 |
+
$args = array(
|
2361 |
+
'id' => 'font_family',
|
2362 |
+
'css_id' => $element_index.'_font_family',
|
2363 |
+
'parent' => $input_name.'[wck_file]',
|
2364 |
+
'title' => __('Font family','post-grid'),
|
2365 |
+
'details' => __('Set font family.','post-grid'),
|
2366 |
+
'type' => 'text',
|
2367 |
+
'value' => $font_family,
|
2368 |
+
'default' => '',
|
2369 |
+
'placeholder' => 'Open Sans',
|
2370 |
+
);
|
2371 |
+
|
2372 |
+
$settings_tabs_field->generate_field($args);
|
2373 |
+
|
2374 |
+
|
2375 |
+
$args = array(
|
2376 |
+
'id' => 'margin',
|
2377 |
+
'css_id' => $element_index.'_margin',
|
2378 |
+
'parent' => $input_name.'[wck_file]',
|
2379 |
+
'title' => __('Margin','post-grid'),
|
2380 |
+
'details' => __('Set margin.','post-grid'),
|
2381 |
+
'type' => 'text',
|
2382 |
+
'value' => $margin,
|
2383 |
+
'default' => '',
|
2384 |
+
'placeholder' => '5px 0',
|
2385 |
+
);
|
2386 |
+
|
2387 |
+
$settings_tabs_field->generate_field($args);
|
2388 |
+
|
2389 |
+
|
2390 |
+
$args = array(
|
2391 |
+
'id' => 'text_align',
|
2392 |
+
'css_id' => $element_index.'_text_align',
|
2393 |
+
'parent' => $input_name.'[wck_file]',
|
2394 |
+
'title' => __('Text align','post-grid'),
|
2395 |
+
'details' => __('Choose text align.','post-grid'),
|
2396 |
+
'type' => 'select',
|
2397 |
+
'value' => $text_align,
|
2398 |
+
'default' => 'left',
|
2399 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
2400 |
+
);
|
2401 |
+
|
2402 |
+
$settings_tabs_field->generate_field($args);
|
2403 |
+
|
2404 |
+
|
2405 |
+
$args = array(
|
2406 |
+
'id' => 'css',
|
2407 |
+
'css_id' => $element_index.'_css',
|
2408 |
+
'parent' => $input_name.'[wck_file]',
|
2409 |
+
'title' => __('Custom CSS','post-grid'),
|
2410 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
2411 |
+
'type' => 'textarea',
|
2412 |
+
'value' => $css,
|
2413 |
+
'default' => '',
|
2414 |
+
'placeholder' => '',
|
2415 |
+
);
|
2416 |
+
|
2417 |
+
$settings_tabs_field->generate_field($args);
|
2418 |
+
|
2419 |
+
$args = array(
|
2420 |
+
'id' => 'css_hover',
|
2421 |
+
'css_id' => $element_index.'_css_hover',
|
2422 |
+
'parent' => $input_name.'[wck_file]',
|
2423 |
+
'title' => __('Hover CSS','post-grid'),
|
2424 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
2425 |
+
'type' => 'textarea',
|
2426 |
+
'value' => $css_hover,
|
2427 |
+
'default' => '',
|
2428 |
+
'placeholder' => '',
|
2429 |
+
);
|
2430 |
+
|
2431 |
+
$settings_tabs_field->generate_field($args);
|
2432 |
+
|
2433 |
+
|
2434 |
+
ob_start();
|
2435 |
+
?>
|
2436 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
2437 |
+
<?php
|
2438 |
+
|
2439 |
+
$html = ob_get_clean();
|
2440 |
+
|
2441 |
+
$args = array(
|
2442 |
+
'id' => 'use_css',
|
2443 |
+
'title' => __('Use of CSS','post-grid'),
|
2444 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
2445 |
+
'type' => 'custom_html',
|
2446 |
+
'html' => $html,
|
2447 |
+
|
2448 |
+
);
|
2449 |
+
|
2450 |
+
$settings_tabs_field->generate_field($args);
|
2451 |
+
|
2452 |
+
?>
|
2453 |
+
|
2454 |
+
</div>
|
2455 |
+
</div>
|
2456 |
+
<?php
|
2457 |
+
|
2458 |
+
}
|
2459 |
+
|
2460 |
+
|
2461 |
+
|
2462 |
+
add_action('post_grid_layout_element_wck_file', 'post_grid_layout_element_wck_file');
|
2463 |
+
function post_grid_layout_element_wck_file($args){
|
2464 |
+
|
2465 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2466 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2467 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2468 |
+
|
2469 |
+
if(empty($post_id)) return;
|
2470 |
+
|
2471 |
+
$title = get_the_title($post_id);
|
2472 |
+
|
2473 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2474 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
2475 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
2476 |
+
|
2477 |
+
|
2478 |
+
|
2479 |
+
//var_dump($wck_value);
|
2480 |
+
|
2481 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
2482 |
+
|
2483 |
+
|
2484 |
+
if(!empty($wck_value)):
|
2485 |
+
|
2486 |
+
if(is_array($wck_value)){
|
2487 |
+
|
2488 |
+
|
2489 |
+
$sizes = isset($wck_value['sizes']) ? $wck_value['sizes'] : array();
|
2490 |
+
$sizes_arr = array();
|
2491 |
+
foreach ($sizes as $sizeIndex => $size){
|
2492 |
+
$sizes_arr['{sizes_'.$sizeIndex.'}'] = $size;
|
2493 |
+
}
|
2494 |
+
|
2495 |
+
$vars = array(
|
2496 |
+
'{ID}'=> isset($wck_value['ID']) ?$wck_value['ID'] : '',
|
2497 |
+
'{id}'=> isset($wck_value['id']) ?$wck_value['id'] : '',
|
2498 |
+
'{title}'=> isset($wck_value['title']) ?$wck_value['title'] : '',
|
2499 |
+
'{filename}'=> isset($wck_value['filename']) ?$wck_value['filename'] : '',
|
2500 |
+
'{filesize}'=> isset($wck_value['filesize']) ? number_format($wck_value['filesize']/1008, 2).'KB' : '',
|
2501 |
+
'{url}'=> isset($wck_value['url']) ?$wck_value['url'] : '',
|
2502 |
+
'{link}'=> isset($wck_value['link']) ?$wck_value['link'] : '',
|
2503 |
+
'{alt}'=> isset($wck_value['alt']) ?$wck_value['alt'] : '',
|
2504 |
+
'{author}'=> isset($wck_value['author']) ?$wck_value['author'] : '',
|
2505 |
+
'{description}'=> isset($wck_value['description']) ?$wck_value['description'] : '',
|
2506 |
+
'{caption}'=> isset($wck_value['caption']) ?$wck_value['caption'] : '',
|
2507 |
+
'{name}'=> isset($wck_value['name']) ?$wck_value['name'] : '',
|
2508 |
+
'{date}'=> isset($wck_value['date']) ?$wck_value['date'] : '',
|
2509 |
+
'{mime_type}'=> isset($wck_value['mime_type']) ?$wck_value['mime_type'] : '',
|
2510 |
+
'{icon}'=> isset($wck_value['icon']) ?$wck_value['icon'] : '',
|
2511 |
+
'{width}'=> isset($wck_value['width']) ?$wck_value['width'] : '',
|
2512 |
+
'{height}'=> isset($wck_value['height']) ?$wck_value['height'] : '',
|
2513 |
+
|
2514 |
+
);
|
2515 |
+
|
2516 |
+
$vars = array_merge($vars,$sizes_arr);
|
2517 |
+
|
2518 |
+
//echo '<pre style="text-align: left">'.var_export($vars, true).'</pre>';
|
2519 |
+
|
2520 |
+
|
2521 |
+
$wck_value = strtr($wrapper_html, $vars);
|
2522 |
+
|
2523 |
+
|
2524 |
+
}else{
|
2525 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
2526 |
+
}
|
2527 |
+
|
2528 |
+
|
2529 |
+
?>
|
2530 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_file ">
|
2531 |
+
<?php echo ($wck_value); ?>
|
2532 |
+
</div>
|
2533 |
+
<?php
|
2534 |
+
endif;
|
2535 |
+
|
2536 |
+
}
|
2537 |
+
|
2538 |
+
|
2539 |
+
|
2540 |
+
add_action('post_grid_layout_element_css_wck_file', 'post_grid_layout_element_css_wck_file', 10);
|
2541 |
+
function post_grid_layout_element_css_wck_file($args){
|
2542 |
+
|
2543 |
+
|
2544 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2545 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2546 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2547 |
+
|
2548 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2549 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2550 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2551 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2552 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2553 |
+
|
2554 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2555 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2556 |
+
|
2557 |
+
?>
|
2558 |
+
<style type="text/css">
|
2559 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2560 |
+
<?php if(!empty($color)): ?>
|
2561 |
+
color: <?php echo $color; ?>;
|
2562 |
+
<?php endif; ?>
|
2563 |
+
<?php if(!empty($font_size)): ?>
|
2564 |
+
font-size: <?php echo $font_size; ?>;
|
2565 |
+
<?php endif; ?>
|
2566 |
+
<?php if(!empty($font_family)): ?>
|
2567 |
+
font-family: <?php echo $font_family; ?>;
|
2568 |
+
<?php endif; ?>
|
2569 |
+
<?php if(!empty($margin)): ?>
|
2570 |
+
margin: <?php echo $margin; ?>;
|
2571 |
+
<?php endif; ?>
|
2572 |
+
<?php if(!empty($text_align)): ?>
|
2573 |
+
text-align: <?php echo $text_align; ?>;
|
2574 |
+
<?php endif; ?>
|
2575 |
+
<?php if(!empty($css)): ?>
|
2576 |
+
<?php echo $css; ?>
|
2577 |
+
<?php endif; ?>
|
2578 |
+
}
|
2579 |
+
<?php if(!empty($css_hover)): ?>
|
2580 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2581 |
+
<?php echo $css_hover; ?>
|
2582 |
+
}
|
2583 |
+
<?php endif; ?>
|
2584 |
+
</style>
|
2585 |
+
<?php
|
2586 |
+
}
|
2587 |
+
|
2588 |
+
|
2589 |
+
add_action('post_grid_layout_element_option_wck_select','post_grid_layout_element_option_wck_select');
|
2590 |
+
function post_grid_layout_element_option_wck_select($parameters){
|
2591 |
+
|
2592 |
+
$settings_tabs_field = new settings_tabs_field();
|
2593 |
+
|
2594 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2595 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2596 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2597 |
+
|
2598 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
2599 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
2600 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
2601 |
+
|
2602 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2603 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2604 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2605 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2606 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2607 |
+
|
2608 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
2609 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
2610 |
+
|
2611 |
+
|
2612 |
+
|
2613 |
+
?>
|
2614 |
+
<div class="item">
|
2615 |
+
<div class="element-title header ">
|
2616 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2617 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2618 |
+
|
2619 |
+
<span class="expand"><?php echo __('WCK Select','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
2620 |
+
</div>
|
2621 |
+
<div class="element-options options">
|
2622 |
+
|
2623 |
+
<?php
|
2624 |
+
|
2625 |
+
$args = array(
|
2626 |
+
'id' => 'wck_key',
|
2627 |
+
'css_id' => $element_index.'_text',
|
2628 |
+
'parent' => $input_name.'[wck_select]',
|
2629 |
+
'title' => __('WCK key','post-grid'),
|
2630 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
2631 |
+
'type' => 'text',
|
2632 |
+
'value' => $wck_key,
|
2633 |
+
'default' => '',
|
2634 |
+
'placeholder' => '',
|
2635 |
+
);
|
2636 |
+
|
2637 |
+
$settings_tabs_field->generate_field($args);
|
2638 |
+
|
2639 |
+
$args = array(
|
2640 |
+
'id' => 'item_wrapper_html',
|
2641 |
+
'css_id' => $element_index.'_wrapper_html',
|
2642 |
+
'parent' => $input_name.'[wck_select]',
|
2643 |
+
'title' => __('Item wrapper html','post-grid'),
|
2644 |
+
'details' => __('Write item wrapper html, use <code>%s</code> to replace output. <br>Return Format: Label or Value<br> ex: <code>Value: %s</code> <br>Return Format: Both(Array)<br> ex: <code>Label: %s</code> <code>Value: %s</code> list item ex: <code><li>%s</li></code>','post-grid'),
|
2645 |
+
'type' => 'text',
|
2646 |
+
'value' => $item_wrapper_html,
|
2647 |
+
'default' => '',
|
2648 |
+
'placeholder' => 'Value: %s',
|
2649 |
+
);
|
2650 |
+
|
2651 |
+
$settings_tabs_field->generate_field($args);
|
2652 |
+
|
2653 |
+
|
2654 |
+
$args = array(
|
2655 |
+
'id' => 'wrapper_html',
|
2656 |
+
'css_id' => $element_index.'_wrapper_html',
|
2657 |
+
'parent' => $input_name.'[wck_select]',
|
2658 |
+
'title' => __('Wrapper html','post-grid'),
|
2659 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>, <code>Values: %s</code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
2660 |
+
'type' => 'text',
|
2661 |
+
'value' => $wrapper_html,
|
2662 |
+
'default' => '',
|
2663 |
+
'placeholder' => 'Value: %s',
|
2664 |
+
);
|
2665 |
+
|
2666 |
+
$settings_tabs_field->generate_field($args);
|
2667 |
+
|
2668 |
+
|
2669 |
+
$args = array(
|
2670 |
+
'id' => 'color',
|
2671 |
+
'css_id' => $element_index.'_wck_select',
|
2672 |
+
'parent' => $input_name.'[wck_select]',
|
2673 |
+
'title' => __('Color','post-grid'),
|
2674 |
+
'details' => __('Title text color.','post-grid'),
|
2675 |
+
'type' => 'colorpicker',
|
2676 |
+
'value' => $color,
|
2677 |
+
'default' => '',
|
2678 |
+
);
|
2679 |
+
|
2680 |
+
$settings_tabs_field->generate_field($args);
|
2681 |
+
|
2682 |
+
$args = array(
|
2683 |
+
'id' => 'font_size',
|
2684 |
+
'css_id' => $element_index.'_font_size',
|
2685 |
+
'parent' => $input_name.'[wck_select]',
|
2686 |
+
'title' => __('Font size','post-grid'),
|
2687 |
+
'details' => __('Set font size.','post-grid'),
|
2688 |
+
'type' => 'text',
|
2689 |
+
'value' => $font_size,
|
2690 |
+
'default' => '',
|
2691 |
+
'placeholder' => '14px',
|
2692 |
+
);
|
2693 |
+
|
2694 |
+
$settings_tabs_field->generate_field($args);
|
2695 |
+
|
2696 |
+
|
2697 |
+
$args = array(
|
2698 |
+
'id' => 'font_family',
|
2699 |
+
'css_id' => $element_index.'_font_family',
|
2700 |
+
'parent' => $input_name.'[wck_select]',
|
2701 |
+
'title' => __('Font family','post-grid'),
|
2702 |
+
'details' => __('Set font family.','post-grid'),
|
2703 |
+
'type' => 'text',
|
2704 |
+
'value' => $font_family,
|
2705 |
+
'default' => '',
|
2706 |
+
'placeholder' => 'Open Sans',
|
2707 |
+
);
|
2708 |
+
|
2709 |
+
$settings_tabs_field->generate_field($args);
|
2710 |
+
|
2711 |
+
|
2712 |
+
$args = array(
|
2713 |
+
'id' => 'margin',
|
2714 |
+
'css_id' => $element_index.'_margin',
|
2715 |
+
'parent' => $input_name.'[wck_select]',
|
2716 |
+
'title' => __('Margin','post-grid'),
|
2717 |
+
'details' => __('Set margin.','post-grid'),
|
2718 |
+
'type' => 'text',
|
2719 |
+
'value' => $margin,
|
2720 |
+
'default' => '',
|
2721 |
+
'placeholder' => '5px 0',
|
2722 |
+
);
|
2723 |
+
|
2724 |
+
$settings_tabs_field->generate_field($args);
|
2725 |
+
|
2726 |
+
|
2727 |
+
$args = array(
|
2728 |
+
'id' => 'text_align',
|
2729 |
+
'css_id' => $element_index.'_text_align',
|
2730 |
+
'parent' => $input_name.'[wck_select]',
|
2731 |
+
'title' => __('Text align','post-grid'),
|
2732 |
+
'details' => __('Choose text align.','post-grid'),
|
2733 |
+
'type' => 'select',
|
2734 |
+
'value' => $text_align,
|
2735 |
+
'default' => 'left',
|
2736 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
2737 |
+
);
|
2738 |
+
|
2739 |
+
$settings_tabs_field->generate_field($args);
|
2740 |
+
|
2741 |
+
|
2742 |
+
$args = array(
|
2743 |
+
'id' => 'css',
|
2744 |
+
'css_id' => $element_index.'_css',
|
2745 |
+
'parent' => $input_name.'[wck_select]',
|
2746 |
+
'title' => __('Custom CSS','post-grid'),
|
2747 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
2748 |
+
'type' => 'textarea',
|
2749 |
+
'value' => $css,
|
2750 |
+
'default' => '',
|
2751 |
+
'placeholder' => '',
|
2752 |
+
);
|
2753 |
+
|
2754 |
+
$settings_tabs_field->generate_field($args);
|
2755 |
+
|
2756 |
+
$args = array(
|
2757 |
+
'id' => 'css_hover',
|
2758 |
+
'css_id' => $element_index.'_css_hover',
|
2759 |
+
'parent' => $input_name.'[wck_select]',
|
2760 |
+
'title' => __('Hover CSS','post-grid'),
|
2761 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
2762 |
+
'type' => 'textarea',
|
2763 |
+
'value' => $css_hover,
|
2764 |
+
'default' => '',
|
2765 |
+
'placeholder' => '',
|
2766 |
+
);
|
2767 |
+
|
2768 |
+
$settings_tabs_field->generate_field($args);
|
2769 |
+
|
2770 |
+
|
2771 |
+
ob_start();
|
2772 |
+
?>
|
2773 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
2774 |
+
<?php
|
2775 |
+
|
2776 |
+
$html = ob_get_clean();
|
2777 |
+
|
2778 |
+
$args = array(
|
2779 |
+
'id' => 'use_css',
|
2780 |
+
'title' => __('Use of CSS','post-grid'),
|
2781 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
2782 |
+
'type' => 'custom_html',
|
2783 |
+
'html' => $html,
|
2784 |
+
|
2785 |
+
);
|
2786 |
+
|
2787 |
+
$settings_tabs_field->generate_field($args);
|
2788 |
+
|
2789 |
+
?>
|
2790 |
+
|
2791 |
+
</div>
|
2792 |
+
</div>
|
2793 |
+
<?php
|
2794 |
+
|
2795 |
+
}
|
2796 |
+
|
2797 |
+
|
2798 |
+
|
2799 |
+
add_action('post_grid_layout_element_wck_select', 'post_grid_layout_element_wck_select');
|
2800 |
+
function post_grid_layout_element_wck_select($args){
|
2801 |
+
|
2802 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2803 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
2804 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
2805 |
+
|
2806 |
+
if(empty($post_id)) return;
|
2807 |
+
|
2808 |
+
$title = get_the_title($post_id);
|
2809 |
+
|
2810 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
2811 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
2812 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
2813 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
2814 |
+
|
2815 |
+
|
2816 |
+
|
2817 |
+
//var_dump($wck_key);
|
2818 |
+
//var_dump($item_wrapper_html);
|
2819 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
2820 |
+
|
2821 |
+
//var_dump($wck_value);
|
2822 |
+
|
2823 |
+
$html = '';
|
2824 |
+
|
2825 |
+
if(!empty($wck_value)):
|
2826 |
+
|
2827 |
+
if(is_array($wck_value)){
|
2828 |
+
foreach ($wck_value as $_items){
|
2829 |
+
//var_dump($_items);
|
2830 |
+
$html .= sprintf($item_wrapper_html, $_items);
|
2831 |
+
|
2832 |
+
|
2833 |
+
}
|
2834 |
+
}else{
|
2835 |
+
$html = sprintf($item_wrapper_html, $wck_value);
|
2836 |
+
}
|
2837 |
+
|
2838 |
+
|
2839 |
+
$html = sprintf($wrapper_html, $html);
|
2840 |
+
|
2841 |
+
?>
|
2842 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_select ">
|
2843 |
+
<?php echo ($html); ?>
|
2844 |
+
</div>
|
2845 |
+
<?php
|
2846 |
+
endif;
|
2847 |
+
|
2848 |
+
}
|
2849 |
+
|
2850 |
+
|
2851 |
+
|
2852 |
+
add_action('post_grid_layout_element_css_wck_select', 'post_grid_layout_element_css_wck_select', 10);
|
2853 |
+
function post_grid_layout_element_css_wck_select($args){
|
2854 |
+
|
2855 |
+
|
2856 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
2857 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
2858 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
2859 |
+
|
2860 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
2861 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
2862 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
2863 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
2864 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
2865 |
+
|
2866 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
2867 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
2868 |
+
|
2869 |
+
?>
|
2870 |
+
<style type="text/css">
|
2871 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
2872 |
+
<?php if(!empty($color)): ?>
|
2873 |
+
color: <?php echo $color; ?>;
|
2874 |
+
<?php endif; ?>
|
2875 |
+
<?php if(!empty($font_size)): ?>
|
2876 |
+
font-size: <?php echo $font_size; ?>;
|
2877 |
+
<?php endif; ?>
|
2878 |
+
<?php if(!empty($font_family)): ?>
|
2879 |
+
font-family: <?php echo $font_family; ?>;
|
2880 |
+
<?php endif; ?>
|
2881 |
+
<?php if(!empty($margin)): ?>
|
2882 |
+
margin: <?php echo $margin; ?>;
|
2883 |
+
<?php endif; ?>
|
2884 |
+
<?php if(!empty($text_align)): ?>
|
2885 |
+
text-align: <?php echo $text_align; ?>;
|
2886 |
+
<?php endif; ?>
|
2887 |
+
<?php if(!empty($css)): ?>
|
2888 |
+
<?php echo $css; ?>
|
2889 |
+
<?php endif; ?>
|
2890 |
+
}
|
2891 |
+
<?php if(!empty($css_hover)): ?>
|
2892 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
2893 |
+
<?php echo $css_hover; ?>
|
2894 |
+
}
|
2895 |
+
<?php endif; ?>
|
2896 |
+
</style>
|
2897 |
+
<?php
|
2898 |
+
}
|
2899 |
+
|
2900 |
+
|
2901 |
+
add_action('post_grid_layout_element_option_wck_checkbox','post_grid_layout_element_option_wck_checkbox');
|
2902 |
+
function post_grid_layout_element_option_wck_checkbox($parameters){
|
2903 |
+
|
2904 |
+
$settings_tabs_field = new settings_tabs_field();
|
2905 |
+
|
2906 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2907 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2908 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2909 |
+
|
2910 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
2911 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
2912 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
2913 |
+
|
2914 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2915 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2916 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2917 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2918 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2919 |
+
|
2920 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
2921 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
2922 |
+
|
2923 |
+
|
2924 |
+
|
2925 |
+
?>
|
2926 |
+
<div class="item">
|
2927 |
+
<div class="element-title header ">
|
2928 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2929 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2930 |
+
|
2931 |
+
<span class="expand"><?php echo __('WCK Checkbox','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
2932 |
+
</div>
|
2933 |
+
<div class="element-options options">
|
2934 |
+
|
2935 |
+
<?php
|
2936 |
+
|
2937 |
+
$args = array(
|
2938 |
+
'id' => 'wck_key',
|
2939 |
+
'css_id' => $element_index.'_text',
|
2940 |
+
'parent' => $input_name.'[wck_checkbox]',
|
2941 |
+
'title' => __('WCK key','post-grid'),
|
2942 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
2943 |
+
'type' => 'text',
|
2944 |
+
'value' => $wck_key,
|
2945 |
+
'default' => '',
|
2946 |
+
'placeholder' => '',
|
2947 |
+
);
|
2948 |
+
|
2949 |
+
$settings_tabs_field->generate_field($args);
|
2950 |
+
|
2951 |
+
$args = array(
|
2952 |
+
'id' => 'item_wrapper_html',
|
2953 |
+
'css_id' => $element_index.'_wrapper_html',
|
2954 |
+
'parent' => $input_name.'[wck_checkbox]',
|
2955 |
+
'title' => __('Item wrapper html','post-grid'),
|
2956 |
+
'details' => __('Write item wrapper html, use <code>%s</code> to replace output. <br>Return Format: Label or Value<br> ex: <code>Value: %s</code> <br>Return Format: Both(Array)<br> ex: <code>Label: %s</code> <code>Value: %s</code> list item ex: <code><li>%s</li></code>','post-grid'),
|
2957 |
+
'type' => 'text',
|
2958 |
+
'value' => $item_wrapper_html,
|
2959 |
+
'default' => '',
|
2960 |
+
'placeholder' => 'Value: %s',
|
2961 |
+
);
|
2962 |
+
|
2963 |
+
$settings_tabs_field->generate_field($args);
|
2964 |
+
|
2965 |
+
|
2966 |
+
$args = array(
|
2967 |
+
'id' => 'wrapper_html',
|
2968 |
+
'css_id' => $element_index.'_wrapper_html',
|
2969 |
+
'parent' => $input_name.'[wck_checkbox]',
|
2970 |
+
'title' => __('Wrapper html','post-grid'),
|
2971 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>, <code>Values: %s</code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
2972 |
+
'type' => 'text',
|
2973 |
+
'value' => $wrapper_html,
|
2974 |
+
'default' => '',
|
2975 |
+
'placeholder' => 'Value: %s',
|
2976 |
+
);
|
2977 |
+
|
2978 |
+
$settings_tabs_field->generate_field($args);
|
2979 |
+
|
2980 |
+
|
2981 |
+
$args = array(
|
2982 |
+
'id' => 'color',
|
2983 |
+
'css_id' => $element_index.'_wck_checkbox',
|
2984 |
+
'parent' => $input_name.'[wck_checkbox]',
|
2985 |
+
'title' => __('Color','post-grid'),
|
2986 |
+
'details' => __('Title text color.','post-grid'),
|
2987 |
+
'type' => 'colorpicker',
|
2988 |
+
'value' => $color,
|
2989 |
+
'default' => '',
|
2990 |
+
);
|
2991 |
+
|
2992 |
+
$settings_tabs_field->generate_field($args);
|
2993 |
+
|
2994 |
+
$args = array(
|
2995 |
+
'id' => 'font_size',
|
2996 |
+
'css_id' => $element_index.'_font_size',
|
2997 |
+
'parent' => $input_name.'[wck_checkbox]',
|
2998 |
+
'title' => __('Font size','post-grid'),
|
2999 |
+
'details' => __('Set font size.','post-grid'),
|
3000 |
+
'type' => 'text',
|
3001 |
+
'value' => $font_size,
|
3002 |
+
'default' => '',
|
3003 |
+
'placeholder' => '14px',
|
3004 |
+
);
|
3005 |
+
|
3006 |
+
$settings_tabs_field->generate_field($args);
|
3007 |
+
|
3008 |
+
|
3009 |
+
$args = array(
|
3010 |
+
'id' => 'font_family',
|
3011 |
+
'css_id' => $element_index.'_font_family',
|
3012 |
+
'parent' => $input_name.'[wck_checkbox]',
|
3013 |
+
'title' => __('Font family','post-grid'),
|
3014 |
+
'details' => __('Set font family.','post-grid'),
|
3015 |
+
'type' => 'text',
|
3016 |
+
'value' => $font_family,
|
3017 |
+
'default' => '',
|
3018 |
+
'placeholder' => 'Open Sans',
|
3019 |
+
);
|
3020 |
+
|
3021 |
+
$settings_tabs_field->generate_field($args);
|
3022 |
+
|
3023 |
+
|
3024 |
+
$args = array(
|
3025 |
+
'id' => 'margin',
|
3026 |
+
'css_id' => $element_index.'_margin',
|
3027 |
+
'parent' => $input_name.'[wck_checkbox]',
|
3028 |
+
'title' => __('Margin','post-grid'),
|
3029 |
+
'details' => __('Set margin.','post-grid'),
|
3030 |
+
'type' => 'text',
|
3031 |
+
'value' => $margin,
|
3032 |
+
'default' => '',
|
3033 |
+
'placeholder' => '5px 0',
|
3034 |
+
);
|
3035 |
+
|
3036 |
+
$settings_tabs_field->generate_field($args);
|
3037 |
+
|
3038 |
+
|
3039 |
+
$args = array(
|
3040 |
+
'id' => 'text_align',
|
3041 |
+
'css_id' => $element_index.'_text_align',
|
3042 |
+
'parent' => $input_name.'[wck_checkbox]',
|
3043 |
+
'title' => __('Text align','post-grid'),
|
3044 |
+
'details' => __('Choose text align.','post-grid'),
|
3045 |
+
'type' => 'select',
|
3046 |
+
'value' => $text_align,
|
3047 |
+
'default' => 'left',
|
3048 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
3049 |
+
);
|
3050 |
+
|
3051 |
+
$settings_tabs_field->generate_field($args);
|
3052 |
+
|
3053 |
+
|
3054 |
+
$args = array(
|
3055 |
+
'id' => 'css',
|
3056 |
+
'css_id' => $element_index.'_css',
|
3057 |
+
'parent' => $input_name.'[wck_checkbox]',
|
3058 |
+
'title' => __('Custom CSS','post-grid'),
|
3059 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
3060 |
+
'type' => 'textarea',
|
3061 |
+
'value' => $css,
|
3062 |
+
'default' => '',
|
3063 |
+
'placeholder' => '',
|
3064 |
+
);
|
3065 |
+
|
3066 |
+
$settings_tabs_field->generate_field($args);
|
3067 |
+
|
3068 |
+
$args = array(
|
3069 |
+
'id' => 'css_hover',
|
3070 |
+
'css_id' => $element_index.'_css_hover',
|
3071 |
+
'parent' => $input_name.'[wck_checkbox]',
|
3072 |
+
'title' => __('Hover CSS','post-grid'),
|
3073 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
3074 |
+
'type' => 'textarea',
|
3075 |
+
'value' => $css_hover,
|
3076 |
+
'default' => '',
|
3077 |
+
'placeholder' => '',
|
3078 |
+
);
|
3079 |
+
|
3080 |
+
$settings_tabs_field->generate_field($args);
|
3081 |
+
|
3082 |
+
|
3083 |
+
ob_start();
|
3084 |
+
?>
|
3085 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
3086 |
+
<?php
|
3087 |
+
|
3088 |
+
$html = ob_get_clean();
|
3089 |
+
|
3090 |
+
$args = array(
|
3091 |
+
'id' => 'use_css',
|
3092 |
+
'title' => __('Use of CSS','post-grid'),
|
3093 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
3094 |
+
'type' => 'custom_html',
|
3095 |
+
'html' => $html,
|
3096 |
+
|
3097 |
+
);
|
3098 |
+
|
3099 |
+
$settings_tabs_field->generate_field($args);
|
3100 |
+
|
3101 |
+
?>
|
3102 |
+
|
3103 |
+
</div>
|
3104 |
+
</div>
|
3105 |
+
<?php
|
3106 |
+
|
3107 |
+
}
|
3108 |
+
|
3109 |
+
|
3110 |
+
|
3111 |
+
add_action('post_grid_layout_element_wck_checkbox', 'post_grid_layout_element_wck_checkbox');
|
3112 |
+
function post_grid_layout_element_wck_checkbox($args){
|
3113 |
+
|
3114 |
+
|
3115 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3116 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
3117 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
3118 |
+
|
3119 |
+
if(empty($post_id)) return;
|
3120 |
+
|
3121 |
+
$title = get_the_title($post_id);
|
3122 |
+
|
3123 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
3124 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
3125 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
3126 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
3127 |
+
|
3128 |
+
|
3129 |
+
|
3130 |
+
//var_dump($wck_key);
|
3131 |
+
//var_dump($item_wrapper_html);
|
3132 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
3133 |
+
|
3134 |
+
$html = '';
|
3135 |
+
|
3136 |
+
if(!empty($wck_value)):
|
3137 |
+
|
3138 |
+
if(is_array($wck_value)){
|
3139 |
+
foreach ($wck_value as $_items){
|
3140 |
+
//var_dump($_items);
|
3141 |
+
$html .= sprintf($item_wrapper_html, $_items);
|
3142 |
+
|
3143 |
+
|
3144 |
+
}
|
3145 |
+
}else{
|
3146 |
+
$html = sprintf($item_wrapper_html, $wck_value);
|
3147 |
+
}
|
3148 |
+
|
3149 |
+
|
3150 |
+
$html = sprintf($wrapper_html, $html);
|
3151 |
+
|
3152 |
+
?>
|
3153 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_checkbox ">
|
3154 |
+
<?php echo ($html); ?>
|
3155 |
+
</div>
|
3156 |
+
<?php
|
3157 |
+
endif;
|
3158 |
+
|
3159 |
+
}
|
3160 |
+
|
3161 |
+
|
3162 |
+
|
3163 |
+
add_action('post_grid_layout_element_css_wck_checkbox', 'post_grid_layout_element_css_wck_checkbox', 10);
|
3164 |
+
function post_grid_layout_element_css_wck_checkbox($args){
|
3165 |
+
|
3166 |
+
|
3167 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
3168 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3169 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
3170 |
+
|
3171 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
3172 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
3173 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
3174 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
3175 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
3176 |
+
|
3177 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
3178 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
3179 |
+
|
3180 |
+
?>
|
3181 |
+
<style type="text/css">
|
3182 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
3183 |
+
<?php if(!empty($color)): ?>
|
3184 |
+
color: <?php echo $color; ?>;
|
3185 |
+
<?php endif; ?>
|
3186 |
+
<?php if(!empty($font_size)): ?>
|
3187 |
+
font-size: <?php echo $font_size; ?>;
|
3188 |
+
<?php endif; ?>
|
3189 |
+
<?php if(!empty($font_family)): ?>
|
3190 |
+
font-family: <?php echo $font_family; ?>;
|
3191 |
+
<?php endif; ?>
|
3192 |
+
<?php if(!empty($margin)): ?>
|
3193 |
+
margin: <?php echo $margin; ?>;
|
3194 |
+
<?php endif; ?>
|
3195 |
+
<?php if(!empty($text_align)): ?>
|
3196 |
+
text-align: <?php echo $text_align; ?>;
|
3197 |
+
<?php endif; ?>
|
3198 |
+
<?php if(!empty($css)): ?>
|
3199 |
+
<?php echo $css; ?>
|
3200 |
+
<?php endif; ?>
|
3201 |
+
}
|
3202 |
+
<?php if(!empty($css_hover)): ?>
|
3203 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
3204 |
+
<?php echo $css_hover; ?>
|
3205 |
+
}
|
3206 |
+
<?php endif; ?>
|
3207 |
+
</style>
|
3208 |
+
<?php
|
3209 |
+
}
|
3210 |
+
|
3211 |
+
|
3212 |
+
|
3213 |
+
add_action('post_grid_layout_element_option_wck_radio','post_grid_layout_element_option_wck_radio');
|
3214 |
+
function post_grid_layout_element_option_wck_radio($parameters){
|
3215 |
+
|
3216 |
+
$settings_tabs_field = new settings_tabs_field();
|
3217 |
+
|
3218 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3219 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3220 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3221 |
+
|
3222 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
3223 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
3224 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
3225 |
+
|
3226 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3227 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3228 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3229 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3230 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3231 |
+
|
3232 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
3233 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
3234 |
+
|
3235 |
+
|
3236 |
+
|
3237 |
+
?>
|
3238 |
+
<div class="item">
|
3239 |
+
<div class="element-title header ">
|
3240 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3241 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3242 |
+
|
3243 |
+
<span class="expand"><?php echo __('WCK Radio','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
3244 |
+
</div>
|
3245 |
+
<div class="element-options options">
|
3246 |
+
|
3247 |
+
<?php
|
3248 |
+
|
3249 |
+
$args = array(
|
3250 |
+
'id' => 'wck_key',
|
3251 |
+
'css_id' => $element_index.'_text',
|
3252 |
+
'parent' => $input_name.'[wck_radio]',
|
3253 |
+
'title' => __('WCK key','post-grid'),
|
3254 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
3255 |
+
'type' => 'text',
|
3256 |
+
'value' => $wck_key,
|
3257 |
+
'default' => '',
|
3258 |
+
'placeholder' => '',
|
3259 |
+
);
|
3260 |
+
|
3261 |
+
$settings_tabs_field->generate_field($args);
|
3262 |
+
|
3263 |
+
$args = array(
|
3264 |
+
'id' => 'item_wrapper_html',
|
3265 |
+
'css_id' => $element_index.'_wrapper_html',
|
3266 |
+
'parent' => $input_name.'[wck_radio]',
|
3267 |
+
'title' => __('Item wrapper html','post-grid'),
|
3268 |
+
'details' => __('Write item wrapper html, use <code>%s</code> to replace output. <br>Return Format: Label or Value<br> ex: <code>Value: %s</code> list item ex: <code><li>%s</li></code>','post-grid'),
|
3269 |
+
'type' => 'text',
|
3270 |
+
'value' => $item_wrapper_html,
|
3271 |
+
'default' => '',
|
3272 |
+
'placeholder' => 'Value: %s',
|
3273 |
+
);
|
3274 |
+
|
3275 |
+
$settings_tabs_field->generate_field($args);
|
3276 |
+
|
3277 |
+
|
3278 |
+
$args = array(
|
3279 |
+
'id' => 'wrapper_html',
|
3280 |
+
'css_id' => $element_index.'_wrapper_html',
|
3281 |
+
'parent' => $input_name.'[wck_radio]',
|
3282 |
+
'title' => __('Wrapper html','post-grid'),
|
3283 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>, <code>Values: %s</code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
3284 |
+
'type' => 'text',
|
3285 |
+
'value' => $wrapper_html,
|
3286 |
+
'default' => '',
|
3287 |
+
'placeholder' => 'Value: %s',
|
3288 |
+
);
|
3289 |
+
|
3290 |
+
$settings_tabs_field->generate_field($args);
|
3291 |
+
|
3292 |
+
|
3293 |
+
$args = array(
|
3294 |
+
'id' => 'color',
|
3295 |
+
'css_id' => $element_index.'_wck_radio',
|
3296 |
+
'parent' => $input_name.'[wck_radio]',
|
3297 |
+
'title' => __('Color','post-grid'),
|
3298 |
+
'details' => __('Title text color.','post-grid'),
|
3299 |
+
'type' => 'colorpicker',
|
3300 |
+
'value' => $color,
|
3301 |
+
'default' => '',
|
3302 |
+
);
|
3303 |
+
|
3304 |
+
$settings_tabs_field->generate_field($args);
|
3305 |
+
|
3306 |
+
$args = array(
|
3307 |
+
'id' => 'font_size',
|
3308 |
+
'css_id' => $element_index.'_font_size',
|
3309 |
+
'parent' => $input_name.'[wck_radio]',
|
3310 |
+
'title' => __('Font size','post-grid'),
|
3311 |
+
'details' => __('Set font size.','post-grid'),
|
3312 |
+
'type' => 'text',
|
3313 |
+
'value' => $font_size,
|
3314 |
+
'default' => '',
|
3315 |
+
'placeholder' => '14px',
|
3316 |
+
);
|
3317 |
+
|
3318 |
+
$settings_tabs_field->generate_field($args);
|
3319 |
+
|
3320 |
+
|
3321 |
+
$args = array(
|
3322 |
+
'id' => 'font_family',
|
3323 |
+
'css_id' => $element_index.'_font_family',
|
3324 |
+
'parent' => $input_name.'[wck_radio]',
|
3325 |
+
'title' => __('Font family','post-grid'),
|
3326 |
+
'details' => __('Set font family.','post-grid'),
|
3327 |
+
'type' => 'text',
|
3328 |
+
'value' => $font_family,
|
3329 |
+
'default' => '',
|
3330 |
+
'placeholder' => 'Open Sans',
|
3331 |
+
);
|
3332 |
+
|
3333 |
+
$settings_tabs_field->generate_field($args);
|
3334 |
+
|
3335 |
+
|
3336 |
+
$args = array(
|
3337 |
+
'id' => 'margin',
|
3338 |
+
'css_id' => $element_index.'_margin',
|
3339 |
+
'parent' => $input_name.'[wck_radio]',
|
3340 |
+
'title' => __('Margin','post-grid'),
|
3341 |
+
'details' => __('Set margin.','post-grid'),
|
3342 |
+
'type' => 'text',
|
3343 |
+
'value' => $margin,
|
3344 |
+
'default' => '',
|
3345 |
+
'placeholder' => '5px 0',
|
3346 |
+
);
|
3347 |
+
|
3348 |
+
$settings_tabs_field->generate_field($args);
|
3349 |
+
|
3350 |
+
|
3351 |
+
$args = array(
|
3352 |
+
'id' => 'text_align',
|
3353 |
+
'css_id' => $element_index.'_text_align',
|
3354 |
+
'parent' => $input_name.'[wck_radio]',
|
3355 |
+
'title' => __('Text align','post-grid'),
|
3356 |
+
'details' => __('Choose text align.','post-grid'),
|
3357 |
+
'type' => 'select',
|
3358 |
+
'value' => $text_align,
|
3359 |
+
'default' => 'left',
|
3360 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
3361 |
+
);
|
3362 |
+
|
3363 |
+
$settings_tabs_field->generate_field($args);
|
3364 |
+
|
3365 |
+
|
3366 |
+
$args = array(
|
3367 |
+
'id' => 'css',
|
3368 |
+
'css_id' => $element_index.'_css',
|
3369 |
+
'parent' => $input_name.'[wck_radio]',
|
3370 |
+
'title' => __('Custom CSS','post-grid'),
|
3371 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
3372 |
+
'type' => 'textarea',
|
3373 |
+
'value' => $css,
|
3374 |
+
'default' => '',
|
3375 |
+
'placeholder' => '',
|
3376 |
+
);
|
3377 |
+
|
3378 |
+
$settings_tabs_field->generate_field($args);
|
3379 |
+
|
3380 |
+
$args = array(
|
3381 |
+
'id' => 'css_hover',
|
3382 |
+
'css_id' => $element_index.'_css_hover',
|
3383 |
+
'parent' => $input_name.'[wck_radio]',
|
3384 |
+
'title' => __('Hover CSS','post-grid'),
|
3385 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
3386 |
+
'type' => 'textarea',
|
3387 |
+
'value' => $css_hover,
|
3388 |
+
'default' => '',
|
3389 |
+
'placeholder' => '',
|
3390 |
+
);
|
3391 |
+
|
3392 |
+
$settings_tabs_field->generate_field($args);
|
3393 |
+
|
3394 |
+
|
3395 |
+
ob_start();
|
3396 |
+
?>
|
3397 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
3398 |
+
<?php
|
3399 |
+
|
3400 |
+
$html = ob_get_clean();
|
3401 |
+
|
3402 |
+
$args = array(
|
3403 |
+
'id' => 'use_css',
|
3404 |
+
'title' => __('Use of CSS','post-grid'),
|
3405 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
3406 |
+
'type' => 'custom_html',
|
3407 |
+
'html' => $html,
|
3408 |
+
|
3409 |
+
);
|
3410 |
+
|
3411 |
+
$settings_tabs_field->generate_field($args);
|
3412 |
+
|
3413 |
+
?>
|
3414 |
+
|
3415 |
+
</div>
|
3416 |
+
</div>
|
3417 |
+
<?php
|
3418 |
+
|
3419 |
+
}
|
3420 |
+
|
3421 |
+
|
3422 |
+
|
3423 |
+
add_action('post_grid_layout_element_wck_radio', 'post_grid_layout_element_wck_radio');
|
3424 |
+
function post_grid_layout_element_wck_radio($args){
|
3425 |
+
|
3426 |
+
|
3427 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3428 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
3429 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
3430 |
+
|
3431 |
+
if(empty($post_id)) return;
|
3432 |
+
|
3433 |
+
$title = get_the_title($post_id);
|
3434 |
+
|
3435 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
3436 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
3437 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
3438 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
3439 |
+
|
3440 |
+
|
3441 |
+
|
3442 |
+
//var_dump($wck_key);
|
3443 |
+
//var_dump($item_wrapper_html);
|
3444 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
3445 |
+
|
3446 |
+
//var_dump($wck_value);
|
3447 |
+
|
3448 |
+
$html = '';
|
3449 |
+
|
3450 |
+
if(!empty($wck_value)):
|
3451 |
+
|
3452 |
+
if(is_array($wck_value)){
|
3453 |
+
|
3454 |
+
|
3455 |
+
if(is_array($wck_value)){
|
3456 |
+
$value = $wck_value['value'];
|
3457 |
+
$label = $wck_value['label'];
|
3458 |
+
|
3459 |
+
//$html .= $label.$value;
|
3460 |
+
$html .= sprintf($item_wrapper_html, $label, $value);
|
3461 |
+
}else{
|
3462 |
+
$html .= sprintf($wrapper_html, $wck_value);
|
3463 |
+
}
|
3464 |
+
|
3465 |
+
}else{
|
3466 |
+
$html = sprintf($item_wrapper_html, $wck_value);
|
3467 |
+
}
|
3468 |
+
|
3469 |
+
|
3470 |
+
$html = sprintf($wrapper_html, $html);
|
3471 |
+
|
3472 |
+
?>
|
3473 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_radio ">
|
3474 |
+
<?php echo ($html); ?>
|
3475 |
+
</div>
|
3476 |
+
<?php
|
3477 |
+
endif;
|
3478 |
+
|
3479 |
+
}
|
3480 |
+
|
3481 |
+
|
3482 |
+
|
3483 |
+
add_action('post_grid_layout_element_css_wck_radio', 'post_grid_layout_element_css_wck_radio', 10);
|
3484 |
+
function post_grid_layout_element_css_wck_radio($args){
|
3485 |
+
|
3486 |
+
|
3487 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
3488 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3489 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
3490 |
+
|
3491 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
3492 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
3493 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
3494 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
3495 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
3496 |
+
|
3497 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
3498 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
3499 |
+
|
3500 |
+
?>
|
3501 |
+
<style type="text/css">
|
3502 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
3503 |
+
<?php if(!empty($color)): ?>
|
3504 |
+
color: <?php echo $color; ?>;
|
3505 |
+
<?php endif; ?>
|
3506 |
+
<?php if(!empty($font_size)): ?>
|
3507 |
+
font-size: <?php echo $font_size; ?>;
|
3508 |
+
<?php endif; ?>
|
3509 |
+
<?php if(!empty($font_family)): ?>
|
3510 |
+
font-family: <?php echo $font_family; ?>;
|
3511 |
+
<?php endif; ?>
|
3512 |
+
<?php if(!empty($margin)): ?>
|
3513 |
+
margin: <?php echo $margin; ?>;
|
3514 |
+
<?php endif; ?>
|
3515 |
+
<?php if(!empty($text_align)): ?>
|
3516 |
+
text-align: <?php echo $text_align; ?>;
|
3517 |
+
<?php endif; ?>
|
3518 |
+
<?php if(!empty($css)): ?>
|
3519 |
+
<?php echo $css; ?>
|
3520 |
+
<?php endif; ?>
|
3521 |
+
}
|
3522 |
+
<?php if(!empty($css_hover)): ?>
|
3523 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
3524 |
+
<?php echo $css_hover; ?>
|
3525 |
+
}
|
3526 |
+
<?php endif; ?>
|
3527 |
+
</style>
|
3528 |
+
<?php
|
3529 |
+
}
|
3530 |
+
|
3531 |
+
|
3532 |
+
|
3533 |
+
add_action('post_grid_layout_element_option_wck_buttongroup','post_grid_layout_element_option_wck_buttongroup');
|
3534 |
+
function post_grid_layout_element_option_wck_buttongroup($parameters){
|
3535 |
+
|
3536 |
+
$settings_tabs_field = new settings_tabs_field();
|
3537 |
+
|
3538 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3539 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3540 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3541 |
+
|
3542 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
3543 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
3544 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
3545 |
+
|
3546 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3547 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3548 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3549 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3550 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3551 |
+
|
3552 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
3553 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
3554 |
+
|
3555 |
+
|
3556 |
+
|
3557 |
+
?>
|
3558 |
+
<div class="item">
|
3559 |
+
<div class="element-title header ">
|
3560 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3561 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3562 |
+
|
3563 |
+
<span class="expand"><?php echo __('WCK Button group','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
3564 |
+
</div>
|
3565 |
+
<div class="element-options options">
|
3566 |
+
|
3567 |
+
<?php
|
3568 |
+
|
3569 |
+
$args = array(
|
3570 |
+
'id' => 'wck_key',
|
3571 |
+
'css_id' => $element_index.'_text',
|
3572 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3573 |
+
'title' => __('WCK key','post-grid'),
|
3574 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
3575 |
+
'type' => 'text',
|
3576 |
+
'value' => $wck_key,
|
3577 |
+
'default' => '',
|
3578 |
+
'placeholder' => '',
|
3579 |
+
);
|
3580 |
+
|
3581 |
+
$settings_tabs_field->generate_field($args);
|
3582 |
+
|
3583 |
+
$args = array(
|
3584 |
+
'id' => 'item_wrapper_html',
|
3585 |
+
'css_id' => $element_index.'_wrapper_html',
|
3586 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3587 |
+
'title' => __('Item wrapper html','post-grid'),
|
3588 |
+
'details' => __('Write item wrapper html, use <code>%s</code> to replace output. <br>Return Format: Label or Value<br> ex: <code>Value: %s</code> <br>list item ex: <code><li>%1$s : %2$s</li></code>','post-grid'),
|
3589 |
+
'type' => 'text',
|
3590 |
+
'value' => $item_wrapper_html,
|
3591 |
+
'default' => '',
|
3592 |
+
'placeholder' => 'Value: %s',
|
3593 |
+
);
|
3594 |
+
|
3595 |
+
$settings_tabs_field->generate_field($args);
|
3596 |
+
|
3597 |
+
|
3598 |
+
$args = array(
|
3599 |
+
'id' => 'wrapper_html',
|
3600 |
+
'css_id' => $element_index.'_wrapper_html',
|
3601 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3602 |
+
'title' => __('Wrapper html','post-grid'),
|
3603 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Links: %s</code>, <code>Values: %s</code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
3604 |
+
'type' => 'text',
|
3605 |
+
'value' => $wrapper_html,
|
3606 |
+
'default' => '',
|
3607 |
+
'placeholder' => 'Value: %s',
|
3608 |
+
);
|
3609 |
+
|
3610 |
+
$settings_tabs_field->generate_field($args);
|
3611 |
+
|
3612 |
+
|
3613 |
+
$args = array(
|
3614 |
+
'id' => 'color',
|
3615 |
+
'css_id' => $element_index.'_wck_buttongroup',
|
3616 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3617 |
+
'title' => __('Color','post-grid'),
|
3618 |
+
'details' => __('Title text color.','post-grid'),
|
3619 |
+
'type' => 'colorpicker',
|
3620 |
+
'value' => $color,
|
3621 |
+
'default' => '',
|
3622 |
+
);
|
3623 |
+
|
3624 |
+
$settings_tabs_field->generate_field($args);
|
3625 |
+
|
3626 |
+
$args = array(
|
3627 |
+
'id' => 'font_size',
|
3628 |
+
'css_id' => $element_index.'_font_size',
|
3629 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3630 |
+
'title' => __('Font size','post-grid'),
|
3631 |
+
'details' => __('Set font size.','post-grid'),
|
3632 |
+
'type' => 'text',
|
3633 |
+
'value' => $font_size,
|
3634 |
+
'default' => '',
|
3635 |
+
'placeholder' => '14px',
|
3636 |
+
);
|
3637 |
+
|
3638 |
+
$settings_tabs_field->generate_field($args);
|
3639 |
+
|
3640 |
+
|
3641 |
+
$args = array(
|
3642 |
+
'id' => 'font_family',
|
3643 |
+
'css_id' => $element_index.'_font_family',
|
3644 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3645 |
+
'title' => __('Font family','post-grid'),
|
3646 |
+
'details' => __('Set font family.','post-grid'),
|
3647 |
+
'type' => 'text',
|
3648 |
+
'value' => $font_family,
|
3649 |
+
'default' => '',
|
3650 |
+
'placeholder' => 'Open Sans',
|
3651 |
+
);
|
3652 |
+
|
3653 |
+
$settings_tabs_field->generate_field($args);
|
3654 |
+
|
3655 |
+
|
3656 |
+
$args = array(
|
3657 |
+
'id' => 'margin',
|
3658 |
+
'css_id' => $element_index.'_margin',
|
3659 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3660 |
+
'title' => __('Margin','post-grid'),
|
3661 |
+
'details' => __('Set margin.','post-grid'),
|
3662 |
+
'type' => 'text',
|
3663 |
+
'value' => $margin,
|
3664 |
+
'default' => '',
|
3665 |
+
'placeholder' => '5px 0',
|
3666 |
+
);
|
3667 |
+
|
3668 |
+
$settings_tabs_field->generate_field($args);
|
3669 |
+
|
3670 |
+
|
3671 |
+
$args = array(
|
3672 |
+
'id' => 'text_align',
|
3673 |
+
'css_id' => $element_index.'_text_align',
|
3674 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3675 |
+
'title' => __('Text align','post-grid'),
|
3676 |
+
'details' => __('Choose text align.','post-grid'),
|
3677 |
+
'type' => 'select',
|
3678 |
+
'value' => $text_align,
|
3679 |
+
'default' => 'left',
|
3680 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
3681 |
+
);
|
3682 |
+
|
3683 |
+
$settings_tabs_field->generate_field($args);
|
3684 |
+
|
3685 |
+
|
3686 |
+
$args = array(
|
3687 |
+
'id' => 'css',
|
3688 |
+
'css_id' => $element_index.'_css',
|
3689 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3690 |
+
'title' => __('Custom CSS','post-grid'),
|
3691 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
3692 |
+
'type' => 'textarea',
|
3693 |
+
'value' => $css,
|
3694 |
+
'default' => '',
|
3695 |
+
'placeholder' => '',
|
3696 |
+
);
|
3697 |
+
|
3698 |
+
$settings_tabs_field->generate_field($args);
|
3699 |
+
|
3700 |
+
$args = array(
|
3701 |
+
'id' => 'css_hover',
|
3702 |
+
'css_id' => $element_index.'_css_hover',
|
3703 |
+
'parent' => $input_name.'[wck_buttongroup]',
|
3704 |
+
'title' => __('Hover CSS','post-grid'),
|
3705 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
3706 |
+
'type' => 'textarea',
|
3707 |
+
'value' => $css_hover,
|
3708 |
+
'default' => '',
|
3709 |
+
'placeholder' => '',
|
3710 |
+
);
|
3711 |
+
|
3712 |
+
$settings_tabs_field->generate_field($args);
|
3713 |
+
|
3714 |
+
|
3715 |
+
ob_start();
|
3716 |
+
?>
|
3717 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
3718 |
+
<?php
|
3719 |
+
|
3720 |
+
$html = ob_get_clean();
|
3721 |
+
|
3722 |
+
$args = array(
|
3723 |
+
'id' => 'use_css',
|
3724 |
+
'title' => __('Use of CSS','post-grid'),
|
3725 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
3726 |
+
'type' => 'custom_html',
|
3727 |
+
'html' => $html,
|
3728 |
+
|
3729 |
+
);
|
3730 |
+
|
3731 |
+
$settings_tabs_field->generate_field($args);
|
3732 |
+
|
3733 |
+
?>
|
3734 |
+
|
3735 |
+
</div>
|
3736 |
+
</div>
|
3737 |
+
<?php
|
3738 |
+
|
3739 |
+
}
|
3740 |
+
|
3741 |
+
|
3742 |
+
|
3743 |
+
add_action('post_grid_layout_element_wck_buttongroup', 'post_grid_layout_element_wck_buttongroup');
|
3744 |
+
function post_grid_layout_element_wck_buttongroup($args){
|
3745 |
+
|
3746 |
+
|
3747 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3748 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
3749 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
3750 |
+
|
3751 |
+
if(empty($post_id)) return;
|
3752 |
+
|
3753 |
+
$title = get_the_title($post_id);
|
3754 |
+
|
3755 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
3756 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
3757 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
3758 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
3759 |
+
|
3760 |
+
|
3761 |
+
|
3762 |
+
//var_dump($wck_key);
|
3763 |
+
//var_dump($item_wrapper_html);
|
3764 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
3765 |
+
|
3766 |
+
//var_dump($wck_value);
|
3767 |
+
|
3768 |
+
$html = '';
|
3769 |
+
|
3770 |
+
if(!empty($wck_value)):
|
3771 |
+
|
3772 |
+
if(is_array($wck_value)){
|
3773 |
+
|
3774 |
+
|
3775 |
+
if(is_array($wck_value)){
|
3776 |
+
$value = $wck_value['value'];
|
3777 |
+
$label = $wck_value['label'];
|
3778 |
+
|
3779 |
+
//$html .= $label.$value;
|
3780 |
+
$html .= sprintf($item_wrapper_html, $label, $value);
|
3781 |
+
}else{
|
3782 |
+
$html .= sprintf($wrapper_html, $wck_value);
|
3783 |
+
}
|
3784 |
+
|
3785 |
+
}else{
|
3786 |
+
$html = sprintf($item_wrapper_html, $wck_value);
|
3787 |
+
}
|
3788 |
+
|
3789 |
+
|
3790 |
+
$html = sprintf($wrapper_html, $html);
|
3791 |
+
|
3792 |
+
?>
|
3793 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_buttongroup ">
|
3794 |
+
<?php echo ($html); ?>
|
3795 |
+
</div>
|
3796 |
+
<?php
|
3797 |
+
endif;
|
3798 |
+
|
3799 |
+
}
|
3800 |
+
|
3801 |
+
|
3802 |
+
|
3803 |
+
add_action('post_grid_layout_element_css_wck_buttongroup', 'post_grid_layout_element_css_wck_buttongroup', 10);
|
3804 |
+
function post_grid_layout_element_css_wck_buttongroup($args){
|
3805 |
+
|
3806 |
+
|
3807 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
3808 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
3809 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
3810 |
+
|
3811 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
3812 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
3813 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
3814 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
3815 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
3816 |
+
|
3817 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
3818 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
3819 |
+
|
3820 |
+
?>
|
3821 |
+
<style type="text/css">
|
3822 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
3823 |
+
<?php if(!empty($color)): ?>
|
3824 |
+
color: <?php echo $color; ?>;
|
3825 |
+
<?php endif; ?>
|
3826 |
+
<?php if(!empty($font_size)): ?>
|
3827 |
+
font-size: <?php echo $font_size; ?>;
|
3828 |
+
<?php endif; ?>
|
3829 |
+
<?php if(!empty($font_family)): ?>
|
3830 |
+
font-family: <?php echo $font_family; ?>;
|
3831 |
+
<?php endif; ?>
|
3832 |
+
<?php if(!empty($margin)): ?>
|
3833 |
+
margin: <?php echo $margin; ?>;
|
3834 |
+
<?php endif; ?>
|
3835 |
+
<?php if(!empty($text_align)): ?>
|
3836 |
+
text-align: <?php echo $text_align; ?>;
|
3837 |
+
<?php endif; ?>
|
3838 |
+
<?php if(!empty($css)): ?>
|
3839 |
+
<?php echo $css; ?>
|
3840 |
+
<?php endif; ?>
|
3841 |
+
}
|
3842 |
+
<?php if(!empty($css_hover)): ?>
|
3843 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
3844 |
+
<?php echo $css_hover; ?>
|
3845 |
+
}
|
3846 |
+
<?php endif; ?>
|
3847 |
+
</style>
|
3848 |
+
<?php
|
3849 |
+
}
|
3850 |
+
|
3851 |
+
|
3852 |
+
add_action('post_grid_layout_element_option_wck_page_link','post_grid_layout_element_option_wck_page_link');
|
3853 |
+
function post_grid_layout_element_option_wck_page_link($parameters){
|
3854 |
+
|
3855 |
+
$settings_tabs_field = new settings_tabs_field();
|
3856 |
+
|
3857 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3858 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3859 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3860 |
+
|
3861 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
3862 |
+
$link_wrapper_html = !empty($element_data['link_wrapper_html']) ? $element_data['link_wrapper_html'] : '%s';
|
3863 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
3864 |
+
|
3865 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3866 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3867 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3868 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3869 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3870 |
+
|
3871 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
3872 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
3873 |
+
|
3874 |
+
|
3875 |
+
|
3876 |
+
?>
|
3877 |
+
<div class="item">
|
3878 |
+
<div class="element-title header ">
|
3879 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3880 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3881 |
+
|
3882 |
+
<span class="expand"><?php echo __('WCK Page link','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
3883 |
+
</div>
|
3884 |
+
<div class="element-options options">
|
3885 |
+
|
3886 |
+
<?php
|
3887 |
+
|
3888 |
+
$args = array(
|
3889 |
+
'id' => 'wck_key',
|
3890 |
+
'css_id' => $element_index.'_text',
|
3891 |
+
'parent' => $input_name.'[wck_page_link]',
|
3892 |
+
'title' => __('WCK key','post-grid'),
|
3893 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
3894 |
+
'type' => 'text',
|
3895 |
+
'value' => $wck_key,
|
3896 |
+
'default' => '',
|
3897 |
+
'placeholder' => '',
|
3898 |
+
);
|
3899 |
+
|
3900 |
+
$settings_tabs_field->generate_field($args);
|
3901 |
+
|
3902 |
+
$args = array(
|
3903 |
+
'id' => 'link_wrapper_html',
|
3904 |
+
'css_id' => $element_index.'_wrapper_html',
|
3905 |
+
'parent' => $input_name.'[wck_page_link]',
|
3906 |
+
'title' => __('Link wrapper html','post-grid'),
|
3907 |
+
'details' => __('Write link wrapper html, use <code>%s</code> to replace output. ex: <code><a href="%s">Visit link</a></code> list item ex: <code><li><a href="%s">Visit link</a></li></code>','post-grid'),
|
3908 |
+
'type' => 'text',
|
3909 |
+
'value' => $link_wrapper_html,
|
3910 |
+
'default' => '',
|
3911 |
+
'placeholder' => 'Link: %s',
|
3912 |
+
);
|
3913 |
+
|
3914 |
+
$settings_tabs_field->generate_field($args);
|
3915 |
+
|
3916 |
+
|
3917 |
+
$args = array(
|
3918 |
+
'id' => 'wrapper_html',
|
3919 |
+
'css_id' => $element_index.'_wrapper_html',
|
3920 |
+
'parent' => $input_name.'[wck_page_link]',
|
3921 |
+
'title' => __('Wrapper html','post-grid'),
|
3922 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Links: %s</code>, <code><a href="%s">Visit link</a></code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
3923 |
+
'type' => 'text',
|
3924 |
+
'value' => $wrapper_html,
|
3925 |
+
'default' => '',
|
3926 |
+
'placeholder' => 'Link: %s',
|
3927 |
+
);
|
3928 |
+
|
3929 |
+
$settings_tabs_field->generate_field($args);
|
3930 |
+
|
3931 |
+
|
3932 |
+
$args = array(
|
3933 |
+
'id' => 'color',
|
3934 |
+
'css_id' => $element_index.'_wck_page_link',
|
3935 |
+
'parent' => $input_name.'[wck_page_link]',
|
3936 |
+
'title' => __('Color','post-grid'),
|
3937 |
+
'details' => __('Title text color.','post-grid'),
|
3938 |
+
'type' => 'colorpicker',
|
3939 |
+
'value' => $color,
|
3940 |
+
'default' => '',
|
3941 |
+
);
|
3942 |
+
|
3943 |
+
$settings_tabs_field->generate_field($args);
|
3944 |
+
|
3945 |
+
$args = array(
|
3946 |
+
'id' => 'font_size',
|
3947 |
+
'css_id' => $element_index.'_font_size',
|
3948 |
+
'parent' => $input_name.'[wck_page_link]',
|
3949 |
+
'title' => __('Font size','post-grid'),
|
3950 |
+
'details' => __('Set font size.','post-grid'),
|
3951 |
+
'type' => 'text',
|
3952 |
+
'value' => $font_size,
|
3953 |
+
'default' => '',
|
3954 |
+
'placeholder' => '14px',
|
3955 |
+
);
|
3956 |
+
|
3957 |
+
$settings_tabs_field->generate_field($args);
|
3958 |
+
|
3959 |
+
|
3960 |
+
$args = array(
|
3961 |
+
'id' => 'font_family',
|
3962 |
+
'css_id' => $element_index.'_font_family',
|
3963 |
+
'parent' => $input_name.'[wck_page_link]',
|
3964 |
+
'title' => __('Font family','post-grid'),
|
3965 |
+
'details' => __('Set font family.','post-grid'),
|
3966 |
+
'type' => 'text',
|
3967 |
+
'value' => $font_family,
|
3968 |
+
'default' => '',
|
3969 |
+
'placeholder' => 'Open Sans',
|
3970 |
+
);
|
3971 |
+
|
3972 |
+
$settings_tabs_field->generate_field($args);
|
3973 |
+
|
3974 |
+
|
3975 |
+
$args = array(
|
3976 |
+
'id' => 'margin',
|
3977 |
+
'css_id' => $element_index.'_margin',
|
3978 |
+
'parent' => $input_name.'[wck_page_link]',
|
3979 |
+
'title' => __('Margin','post-grid'),
|
3980 |
+
'details' => __('Set margin.','post-grid'),
|
3981 |
+
'type' => 'text',
|
3982 |
+
'value' => $margin,
|
3983 |
+
'default' => '',
|
3984 |
+
'placeholder' => '5px 0',
|
3985 |
+
);
|
3986 |
+
|
3987 |
+
$settings_tabs_field->generate_field($args);
|
3988 |
+
|
3989 |
+
|
3990 |
+
$args = array(
|
3991 |
+
'id' => 'text_align',
|
3992 |
+
'css_id' => $element_index.'_text_align',
|
3993 |
+
'parent' => $input_name.'[wck_page_link]',
|
3994 |
+
'title' => __('Text align','post-grid'),
|
3995 |
+
'details' => __('Choose text align.','post-grid'),
|
3996 |
+
'type' => 'select',
|
3997 |
+
'value' => $text_align,
|
3998 |
+
'default' => 'left',
|
3999 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
4000 |
+
);
|
4001 |
+
|
4002 |
+
$settings_tabs_field->generate_field($args);
|
4003 |
+
|
4004 |
+
|
4005 |
+
$args = array(
|
4006 |
+
'id' => 'css',
|
4007 |
+
'css_id' => $element_index.'_css',
|
4008 |
+
'parent' => $input_name.'[wck_page_link]',
|
4009 |
+
'title' => __('Custom CSS','post-grid'),
|
4010 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
4011 |
+
'type' => 'textarea',
|
4012 |
+
'value' => $css,
|
4013 |
+
'default' => '',
|
4014 |
+
'placeholder' => '',
|
4015 |
+
);
|
4016 |
+
|
4017 |
+
$settings_tabs_field->generate_field($args);
|
4018 |
+
|
4019 |
+
$args = array(
|
4020 |
+
'id' => 'css_hover',
|
4021 |
+
'css_id' => $element_index.'_css_hover',
|
4022 |
+
'parent' => $input_name.'[wck_page_link]',
|
4023 |
+
'title' => __('Hover CSS','post-grid'),
|
4024 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
4025 |
+
'type' => 'textarea',
|
4026 |
+
'value' => $css_hover,
|
4027 |
+
'default' => '',
|
4028 |
+
'placeholder' => '',
|
4029 |
+
);
|
4030 |
+
|
4031 |
+
$settings_tabs_field->generate_field($args);
|
4032 |
+
|
4033 |
+
|
4034 |
+
ob_start();
|
4035 |
+
?>
|
4036 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
4037 |
+
<?php
|
4038 |
+
|
4039 |
+
$html = ob_get_clean();
|
4040 |
+
|
4041 |
+
$args = array(
|
4042 |
+
'id' => 'use_css',
|
4043 |
+
'title' => __('Use of CSS','post-grid'),
|
4044 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
4045 |
+
'type' => 'custom_html',
|
4046 |
+
'html' => $html,
|
4047 |
+
|
4048 |
+
);
|
4049 |
+
|
4050 |
+
$settings_tabs_field->generate_field($args);
|
4051 |
+
|
4052 |
+
?>
|
4053 |
+
|
4054 |
+
</div>
|
4055 |
+
</div>
|
4056 |
+
<?php
|
4057 |
+
|
4058 |
+
}
|
4059 |
+
|
4060 |
+
|
4061 |
+
|
4062 |
+
add_action('post_grid_layout_element_wck_page_link', 'post_grid_layout_element_wck_page_link');
|
4063 |
+
function post_grid_layout_element_wck_page_link($args){
|
4064 |
+
|
4065 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4066 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
4067 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
4068 |
+
|
4069 |
+
if(empty($post_id)) return;
|
4070 |
+
|
4071 |
+
$title = get_the_title($post_id);
|
4072 |
+
|
4073 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
4074 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
4075 |
+
$link_wrapper_html = !empty($element['link_wrapper_html']) ? $element['link_wrapper_html'] : '%s';
|
4076 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
4077 |
+
|
4078 |
+
|
4079 |
+
|
4080 |
+
//var_dump($wck_key);
|
4081 |
+
|
4082 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
4083 |
+
|
4084 |
+
//var_dump($wck_value);
|
4085 |
+
|
4086 |
+
if(!empty($wck_value)):
|
4087 |
+
$html = '';
|
4088 |
+
|
4089 |
+
if(is_array($wck_value)):
|
4090 |
+
foreach ($wck_value as $link):
|
4091 |
+
|
4092 |
+
$html .= sprintf($link_wrapper_html, $link);
|
4093 |
+
|
4094 |
+
endforeach;
|
4095 |
+
else:
|
4096 |
+
$html = $wck_value;
|
4097 |
+
|
4098 |
+
endif;
|
4099 |
+
|
4100 |
+
|
4101 |
+
|
4102 |
+
$html = sprintf($wrapper_html, $html);
|
4103 |
+
?>
|
4104 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_page_link ">
|
4105 |
+
<?php echo ($html); ?>
|
4106 |
+
</div>
|
4107 |
+
<?php
|
4108 |
+
endif;
|
4109 |
+
|
4110 |
+
}
|
4111 |
+
|
4112 |
+
|
4113 |
+
|
4114 |
+
add_action('post_grid_layout_element_css_wck_page_link', 'post_grid_layout_element_css_wck_page_link', 10);
|
4115 |
+
function post_grid_layout_element_css_wck_page_link($args){
|
4116 |
+
|
4117 |
+
|
4118 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
4119 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4120 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
4121 |
+
|
4122 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
4123 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
4124 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
4125 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
4126 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
4127 |
+
|
4128 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
4129 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
4130 |
+
|
4131 |
+
?>
|
4132 |
+
<style type="text/css">
|
4133 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
4134 |
+
<?php if(!empty($color)): ?>
|
4135 |
+
color: <?php echo $color; ?>;
|
4136 |
+
<?php endif; ?>
|
4137 |
+
<?php if(!empty($font_size)): ?>
|
4138 |
+
font-size: <?php echo $font_size; ?>;
|
4139 |
+
<?php endif; ?>
|
4140 |
+
<?php if(!empty($font_family)): ?>
|
4141 |
+
font-family: <?php echo $font_family; ?>;
|
4142 |
+
<?php endif; ?>
|
4143 |
+
<?php if(!empty($margin)): ?>
|
4144 |
+
margin: <?php echo $margin; ?>;
|
4145 |
+
<?php endif; ?>
|
4146 |
+
<?php if(!empty($text_align)): ?>
|
4147 |
+
text-align: <?php echo $text_align; ?>;
|
4148 |
+
<?php endif; ?>
|
4149 |
+
<?php if(!empty($css)): ?>
|
4150 |
+
<?php echo $css; ?>
|
4151 |
+
<?php endif; ?>
|
4152 |
+
}
|
4153 |
+
<?php if(!empty($css_hover)): ?>
|
4154 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
4155 |
+
<?php echo $css_hover; ?>
|
4156 |
+
}
|
4157 |
+
<?php endif; ?>
|
4158 |
+
</style>
|
4159 |
+
<?php
|
4160 |
+
}
|
4161 |
+
|
4162 |
+
|
4163 |
+
|
4164 |
+
add_action('post_grid_layout_element_option_wck_taxonomy','post_grid_layout_element_option_wck_taxonomy');
|
4165 |
+
function post_grid_layout_element_option_wck_taxonomy($parameters){
|
4166 |
+
|
4167 |
+
$settings_tabs_field = new settings_tabs_field();
|
4168 |
+
|
4169 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4170 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4171 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4172 |
+
|
4173 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
4174 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
4175 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
4176 |
+
|
4177 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4178 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4179 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4180 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4181 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4182 |
+
|
4183 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
4184 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
4185 |
+
|
4186 |
+
|
4187 |
+
|
4188 |
+
?>
|
4189 |
+
<div class="item">
|
4190 |
+
<div class="element-title header ">
|
4191 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4192 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4193 |
+
|
4194 |
+
<span class="expand"><?php echo __('WCK Taxonomy','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
4195 |
+
</div>
|
4196 |
+
<div class="element-options options">
|
4197 |
+
|
4198 |
+
<?php
|
4199 |
+
|
4200 |
+
$args = array(
|
4201 |
+
'id' => 'wck_key',
|
4202 |
+
'css_id' => $element_index.'_text',
|
4203 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4204 |
+
'title' => __('WCK key','post-grid'),
|
4205 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
4206 |
+
'type' => 'text',
|
4207 |
+
'value' => $wck_key,
|
4208 |
+
'default' => '',
|
4209 |
+
'placeholder' => '',
|
4210 |
+
);
|
4211 |
+
|
4212 |
+
$settings_tabs_field->generate_field($args);
|
4213 |
+
|
4214 |
+
$args = array(
|
4215 |
+
'id' => 'item_wrapper_html',
|
4216 |
+
'css_id' => $element_index.'_wrapper_html',
|
4217 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4218 |
+
'title' => __('Item wrapper html','post-grid'),
|
4219 |
+
'details' => __('Write item wrapper html, <br> <code>Link HTML: <a href="{term_link}">{name}</a> </code> <br> <code>List HTML: <li><a href="{term_link}">{name}</a></li> </code> <br>Parameter<br> <code>{term_id}, {term_link},{name}, {term_group}, {slug},{term_taxonomy_id}, {taxonomy}, {description}, {count} </code>','post-grid'),
|
4220 |
+
'type' => 'text',
|
4221 |
+
'value' => $item_wrapper_html,
|
4222 |
+
'default' => '',
|
4223 |
+
'placeholder' => 'Value: %s',
|
4224 |
+
);
|
4225 |
+
|
4226 |
+
$settings_tabs_field->generate_field($args);
|
4227 |
+
|
4228 |
+
|
4229 |
+
$args = array(
|
4230 |
+
'id' => 'wrapper_html',
|
4231 |
+
'css_id' => $element_index.'_wrapper_html',
|
4232 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4233 |
+
'title' => __('Wrapper html','post-grid'),
|
4234 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Tags: %s</code>, <br> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
4235 |
+
'type' => 'text',
|
4236 |
+
'value' => $wrapper_html,
|
4237 |
+
'default' => '',
|
4238 |
+
'placeholder' => 'Link: %s',
|
4239 |
+
);
|
4240 |
+
|
4241 |
+
$settings_tabs_field->generate_field($args);
|
4242 |
+
|
4243 |
+
|
4244 |
+
|
4245 |
+
$args = array(
|
4246 |
+
'id' => 'color',
|
4247 |
+
'css_id' => $element_index.'_wck_taxonomy',
|
4248 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4249 |
+
'title' => __('Color','post-grid'),
|
4250 |
+
'details' => __('Title text color.','post-grid'),
|
4251 |
+
'type' => 'colorpicker',
|
4252 |
+
'value' => $color,
|
4253 |
+
'default' => '',
|
4254 |
+
);
|
4255 |
+
|
4256 |
+
$settings_tabs_field->generate_field($args);
|
4257 |
+
|
4258 |
+
$args = array(
|
4259 |
+
'id' => 'font_size',
|
4260 |
+
'css_id' => $element_index.'_font_size',
|
4261 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4262 |
+
'title' => __('Font size','post-grid'),
|
4263 |
+
'details' => __('Set font size.','post-grid'),
|
4264 |
+
'type' => 'text',
|
4265 |
+
'value' => $font_size,
|
4266 |
+
'default' => '',
|
4267 |
+
'placeholder' => '14px',
|
4268 |
+
);
|
4269 |
+
|
4270 |
+
$settings_tabs_field->generate_field($args);
|
4271 |
+
|
4272 |
+
|
4273 |
+
$args = array(
|
4274 |
+
'id' => 'font_family',
|
4275 |
+
'css_id' => $element_index.'_font_family',
|
4276 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4277 |
+
'title' => __('Font family','post-grid'),
|
4278 |
+
'details' => __('Set font family.','post-grid'),
|
4279 |
+
'type' => 'text',
|
4280 |
+
'value' => $font_family,
|
4281 |
+
'default' => '',
|
4282 |
+
'placeholder' => 'Open Sans',
|
4283 |
+
);
|
4284 |
+
|
4285 |
+
$settings_tabs_field->generate_field($args);
|
4286 |
+
|
4287 |
+
|
4288 |
+
$args = array(
|
4289 |
+
'id' => 'margin',
|
4290 |
+
'css_id' => $element_index.'_margin',
|
4291 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4292 |
+
'title' => __('Margin','post-grid'),
|
4293 |
+
'details' => __('Set margin.','post-grid'),
|
4294 |
+
'type' => 'text',
|
4295 |
+
'value' => $margin,
|
4296 |
+
'default' => '',
|
4297 |
+
'placeholder' => '5px 0',
|
4298 |
+
);
|
4299 |
+
|
4300 |
+
$settings_tabs_field->generate_field($args);
|
4301 |
+
|
4302 |
+
|
4303 |
+
$args = array(
|
4304 |
+
'id' => 'text_align',
|
4305 |
+
'css_id' => $element_index.'_text_align',
|
4306 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4307 |
+
'title' => __('Text align','post-grid'),
|
4308 |
+
'details' => __('Choose text align.','post-grid'),
|
4309 |
+
'type' => 'select',
|
4310 |
+
'value' => $text_align,
|
4311 |
+
'default' => 'left',
|
4312 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
4313 |
+
);
|
4314 |
+
|
4315 |
+
$settings_tabs_field->generate_field($args);
|
4316 |
+
|
4317 |
+
|
4318 |
+
$args = array(
|
4319 |
+
'id' => 'css',
|
4320 |
+
'css_id' => $element_index.'_css',
|
4321 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4322 |
+
'title' => __('Custom CSS','post-grid'),
|
4323 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
4324 |
+
'type' => 'textarea',
|
4325 |
+
'value' => $css,
|
4326 |
+
'default' => '',
|
4327 |
+
'placeholder' => '',
|
4328 |
+
);
|
4329 |
+
|
4330 |
+
$settings_tabs_field->generate_field($args);
|
4331 |
+
|
4332 |
+
$args = array(
|
4333 |
+
'id' => 'css_hover',
|
4334 |
+
'css_id' => $element_index.'_css_hover',
|
4335 |
+
'parent' => $input_name.'[wck_taxonomy]',
|
4336 |
+
'title' => __('Hover CSS','post-grid'),
|
4337 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
4338 |
+
'type' => 'textarea',
|
4339 |
+
'value' => $css_hover,
|
4340 |
+
'default' => '',
|
4341 |
+
'placeholder' => '',
|
4342 |
+
);
|
4343 |
+
|
4344 |
+
$settings_tabs_field->generate_field($args);
|
4345 |
+
|
4346 |
+
|
4347 |
+
ob_start();
|
4348 |
+
?>
|
4349 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
4350 |
+
<?php
|
4351 |
+
|
4352 |
+
$html = ob_get_clean();
|
4353 |
+
|
4354 |
+
$args = array(
|
4355 |
+
'id' => 'use_css',
|
4356 |
+
'title' => __('Use of CSS','post-grid'),
|
4357 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
4358 |
+
'type' => 'custom_html',
|
4359 |
+
'html' => $html,
|
4360 |
+
|
4361 |
+
);
|
4362 |
+
|
4363 |
+
$settings_tabs_field->generate_field($args);
|
4364 |
+
|
4365 |
+
?>
|
4366 |
+
|
4367 |
+
</div>
|
4368 |
+
</div>
|
4369 |
+
<?php
|
4370 |
+
|
4371 |
+
}
|
4372 |
+
|
4373 |
+
|
4374 |
+
|
4375 |
+
add_action('post_grid_layout_element_wck_taxonomy', 'post_grid_layout_element_wck_taxonomy');
|
4376 |
+
function post_grid_layout_element_wck_taxonomy($args){
|
4377 |
+
|
4378 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4379 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
4380 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
4381 |
+
|
4382 |
+
if(empty($post_id)) return;
|
4383 |
+
|
4384 |
+
$title = get_the_title($post_id);
|
4385 |
+
|
4386 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
4387 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
4388 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
4389 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
4390 |
+
|
4391 |
+
|
4392 |
+
//var_dump($wck_key);
|
4393 |
+
|
4394 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
4395 |
+
|
4396 |
+
//var_dump($item_wrapper_html);
|
4397 |
+
|
4398 |
+
if(!empty($wck_value)):
|
4399 |
+
//var_dump($wck_value);
|
4400 |
+
$term_html = '';
|
4401 |
+
foreach ($wck_value as $term){
|
4402 |
+
|
4403 |
+
//var_dump('#########');
|
4404 |
+
//echo esc_html($item_wrapper_html);
|
4405 |
+
|
4406 |
+
if(is_object($term)){
|
4407 |
+
$vars = array(
|
4408 |
+
'{term_id}'=> isset($term->term_id) ? $term->term_id : '',
|
4409 |
+
'{term_link}'=> get_term_link($term->term_id),
|
4410 |
+
'{name}'=> isset($term->name) ? $term->name : '',
|
4411 |
+
'{slug}'=> isset($term->slug) ? $term->slug : '',
|
4412 |
+
'{term_taxonomy_id}'=> isset($term->term_taxonomy_id) ? $term->term_taxonomy_id : '',
|
4413 |
+
'{taxonomy}'=> isset($term->taxonomy) ? $term->taxonomy : '',
|
4414 |
+
'{description}'=> isset($term->description) ? $term->description : '',
|
4415 |
+
'{count}'=> isset($term->count) ? $term->count : '',
|
4416 |
+
);
|
4417 |
+
|
4418 |
+
$term_html .= strtr($item_wrapper_html, $vars);
|
4419 |
+
}else{
|
4420 |
+
$term_html .= sprintf($item_wrapper_html, $term);
|
4421 |
+
}
|
4422 |
+
|
4423 |
+
}
|
4424 |
+
|
4425 |
+
|
4426 |
+
|
4427 |
+
$html = sprintf($wrapper_html, $term_html);
|
4428 |
+
|
4429 |
+
|
4430 |
+
?>
|
4431 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_taxonomy ">
|
4432 |
+
<?php echo ($html); ?>
|
4433 |
+
</div>
|
4434 |
+
<?php
|
4435 |
+
endif;
|
4436 |
+
|
4437 |
+
}
|
4438 |
+
|
4439 |
+
|
4440 |
+
|
4441 |
+
add_action('post_grid_layout_element_css_wck_taxonomy', 'post_grid_layout_element_css_wck_taxonomy', 10);
|
4442 |
+
function post_grid_layout_element_css_wck_taxonomy($args){
|
4443 |
+
|
4444 |
+
|
4445 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
4446 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4447 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
4448 |
+
|
4449 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
4450 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
4451 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
4452 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
4453 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
4454 |
+
|
4455 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
4456 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
4457 |
+
|
4458 |
+
?>
|
4459 |
+
<style type="text/css">
|
4460 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
4461 |
+
<?php if(!empty($color)): ?>
|
4462 |
+
color: <?php echo $color; ?>;
|
4463 |
+
<?php endif; ?>
|
4464 |
+
<?php if(!empty($font_size)): ?>
|
4465 |
+
font-size: <?php echo $font_size; ?>;
|
4466 |
+
<?php endif; ?>
|
4467 |
+
<?php if(!empty($font_family)): ?>
|
4468 |
+
font-family: <?php echo $font_family; ?>;
|
4469 |
+
<?php endif; ?>
|
4470 |
+
<?php if(!empty($margin)): ?>
|
4471 |
+
margin: <?php echo $margin; ?>;
|
4472 |
+
<?php endif; ?>
|
4473 |
+
<?php if(!empty($text_align)): ?>
|
4474 |
+
text-align: <?php echo $text_align; ?>;
|
4475 |
+
<?php endif; ?>
|
4476 |
+
<?php if(!empty($css)): ?>
|
4477 |
+
<?php echo $css; ?>
|
4478 |
+
<?php endif; ?>
|
4479 |
+
}
|
4480 |
+
<?php if(!empty($css_hover)): ?>
|
4481 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
4482 |
+
<?php echo $css_hover; ?>
|
4483 |
+
}
|
4484 |
+
<?php endif; ?>
|
4485 |
+
</style>
|
4486 |
+
<?php
|
4487 |
+
}
|
4488 |
+
|
4489 |
+
|
4490 |
+
|
4491 |
+
add_action('post_grid_layout_element_option_wck_user','post_grid_layout_element_option_wck_user');
|
4492 |
+
function post_grid_layout_element_option_wck_user($parameters){
|
4493 |
+
|
4494 |
+
$settings_tabs_field = new settings_tabs_field();
|
4495 |
+
|
4496 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4497 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4498 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4499 |
+
|
4500 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
4501 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
4502 |
+
|
4503 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4504 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4505 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4506 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4507 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4508 |
+
|
4509 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
4510 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
4511 |
+
|
4512 |
+
|
4513 |
+
|
4514 |
+
?>
|
4515 |
+
<div class="item">
|
4516 |
+
<div class="element-title header ">
|
4517 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4518 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4519 |
+
|
4520 |
+
<span class="expand"><?php echo __('WCK User','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
4521 |
+
</div>
|
4522 |
+
<div class="element-options options">
|
4523 |
+
|
4524 |
+
<?php
|
4525 |
+
|
4526 |
+
$args = array(
|
4527 |
+
'id' => 'wck_key',
|
4528 |
+
'css_id' => $element_index.'_text',
|
4529 |
+
'parent' => $input_name.'[wck_user]',
|
4530 |
+
'title' => __('WCK key','post-grid'),
|
4531 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
4532 |
+
'type' => 'text',
|
4533 |
+
'value' => $wck_key,
|
4534 |
+
'default' => '',
|
4535 |
+
'placeholder' => '',
|
4536 |
+
);
|
4537 |
+
|
4538 |
+
$settings_tabs_field->generate_field($args);
|
4539 |
+
|
4540 |
+
$args = array(
|
4541 |
+
'id' => 'wrapper_html',
|
4542 |
+
'css_id' => $element_index.'_wrapper_html',
|
4543 |
+
'parent' => $input_name.'[wck_user]',
|
4544 |
+
'title' => __('Wrapper html','post-grid'),
|
4545 |
+
'details' => __('Write item wrapper html, <br> <code>Link HTML: <a href="{user_posts_url}">{display_name}</a> </code> <br>Parameter<br> <code>{ID}, {user_login},{user_nicename}, {user_email}, {user_url},{display_name}, {user_posts_url}, {user_avtar} </code>','post-grid'),
|
4546 |
+
'type' => 'text',
|
4547 |
+
'value' => $wrapper_html,
|
4548 |
+
'default' => '',
|
4549 |
+
'placeholder' => 'Value: %s',
|
4550 |
+
);
|
4551 |
+
|
4552 |
+
$settings_tabs_field->generate_field($args);
|
4553 |
+
|
4554 |
+
|
4555 |
+
$args = array(
|
4556 |
+
'id' => 'color',
|
4557 |
+
'css_id' => $element_index.'_wck_user',
|
4558 |
+
'parent' => $input_name.'[wck_user]',
|
4559 |
+
'title' => __('Color','post-grid'),
|
4560 |
+
'details' => __('Title text color.','post-grid'),
|
4561 |
+
'type' => 'colorpicker',
|
4562 |
+
'value' => $color,
|
4563 |
+
'default' => '',
|
4564 |
+
);
|
4565 |
+
|
4566 |
+
$settings_tabs_field->generate_field($args);
|
4567 |
+
|
4568 |
+
$args = array(
|
4569 |
+
'id' => 'font_size',
|
4570 |
+
'css_id' => $element_index.'_font_size',
|
4571 |
+
'parent' => $input_name.'[wck_user]',
|
4572 |
+
'title' => __('Font size','post-grid'),
|
4573 |
+
'details' => __('Set font size.','post-grid'),
|
4574 |
+
'type' => 'text',
|
4575 |
+
'value' => $font_size,
|
4576 |
+
'default' => '',
|
4577 |
+
'placeholder' => '14px',
|
4578 |
+
);
|
4579 |
+
|
4580 |
+
$settings_tabs_field->generate_field($args);
|
4581 |
+
|
4582 |
+
|
4583 |
+
$args = array(
|
4584 |
+
'id' => 'font_family',
|
4585 |
+
'css_id' => $element_index.'_font_family',
|
4586 |
+
'parent' => $input_name.'[wck_user]',
|
4587 |
+
'title' => __('Font family','post-grid'),
|
4588 |
+
'details' => __('Set font family.','post-grid'),
|
4589 |
+
'type' => 'text',
|
4590 |
+
'value' => $font_family,
|
4591 |
+
'default' => '',
|
4592 |
+
'placeholder' => 'Open Sans',
|
4593 |
+
);
|
4594 |
+
|
4595 |
+
$settings_tabs_field->generate_field($args);
|
4596 |
+
|
4597 |
+
|
4598 |
+
$args = array(
|
4599 |
+
'id' => 'margin',
|
4600 |
+
'css_id' => $element_index.'_margin',
|
4601 |
+
'parent' => $input_name.'[wck_user]',
|
4602 |
+
'title' => __('Margin','post-grid'),
|
4603 |
+
'details' => __('Set margin.','post-grid'),
|
4604 |
+
'type' => 'text',
|
4605 |
+
'value' => $margin,
|
4606 |
+
'default' => '',
|
4607 |
+
'placeholder' => '5px 0',
|
4608 |
+
);
|
4609 |
+
|
4610 |
+
$settings_tabs_field->generate_field($args);
|
4611 |
+
|
4612 |
+
|
4613 |
+
$args = array(
|
4614 |
+
'id' => 'text_align',
|
4615 |
+
'css_id' => $element_index.'_text_align',
|
4616 |
+
'parent' => $input_name.'[wck_user]',
|
4617 |
+
'title' => __('Text align','post-grid'),
|
4618 |
+
'details' => __('Choose text align.','post-grid'),
|
4619 |
+
'type' => 'select',
|
4620 |
+
'value' => $text_align,
|
4621 |
+
'default' => 'left',
|
4622 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
4623 |
+
);
|
4624 |
+
|
4625 |
+
$settings_tabs_field->generate_field($args);
|
4626 |
+
|
4627 |
+
|
4628 |
+
$args = array(
|
4629 |
+
'id' => 'css',
|
4630 |
+
'css_id' => $element_index.'_css',
|
4631 |
+
'parent' => $input_name.'[wck_user]',
|
4632 |
+
'title' => __('Custom CSS','post-grid'),
|
4633 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
4634 |
+
'type' => 'textarea',
|
4635 |
+
'value' => $css,
|
4636 |
+
'default' => '',
|
4637 |
+
'placeholder' => '',
|
4638 |
+
);
|
4639 |
+
|
4640 |
+
$settings_tabs_field->generate_field($args);
|
4641 |
+
|
4642 |
+
$args = array(
|
4643 |
+
'id' => 'css_hover',
|
4644 |
+
'css_id' => $element_index.'_css_hover',
|
4645 |
+
'parent' => $input_name.'[wck_user]',
|
4646 |
+
'title' => __('Hover CSS','post-grid'),
|
4647 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
4648 |
+
'type' => 'textarea',
|
4649 |
+
'value' => $css_hover,
|
4650 |
+
'default' => '',
|
4651 |
+
'placeholder' => '',
|
4652 |
+
);
|
4653 |
+
|
4654 |
+
$settings_tabs_field->generate_field($args);
|
4655 |
+
|
4656 |
+
|
4657 |
+
ob_start();
|
4658 |
+
?>
|
4659 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
4660 |
+
<?php
|
4661 |
+
|
4662 |
+
$html = ob_get_clean();
|
4663 |
+
|
4664 |
+
$args = array(
|
4665 |
+
'id' => 'use_css',
|
4666 |
+
'title' => __('Use of CSS','post-grid'),
|
4667 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
4668 |
+
'type' => 'custom_html',
|
4669 |
+
'html' => $html,
|
4670 |
+
|
4671 |
+
);
|
4672 |
+
|
4673 |
+
$settings_tabs_field->generate_field($args);
|
4674 |
+
|
4675 |
+
?>
|
4676 |
+
|
4677 |
+
</div>
|
4678 |
+
</div>
|
4679 |
+
<?php
|
4680 |
+
|
4681 |
+
}
|
4682 |
+
|
4683 |
+
|
4684 |
+
|
4685 |
+
add_action('post_grid_layout_element_wck_user', 'post_grid_layout_element_wck_user');
|
4686 |
+
function post_grid_layout_element_wck_user($args){
|
4687 |
+
|
4688 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4689 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
4690 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
4691 |
+
|
4692 |
+
if(empty($post_id)) return;
|
4693 |
+
|
4694 |
+
$title = get_the_title($post_id);
|
4695 |
+
|
4696 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
4697 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
4698 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
4699 |
+
|
4700 |
+
|
4701 |
+
|
4702 |
+
//var_dump($wck_key);
|
4703 |
+
|
4704 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
4705 |
+
|
4706 |
+
|
4707 |
+
//var_dump($wck_value);
|
4708 |
+
|
4709 |
+
if(!empty($wck_value)):
|
4710 |
+
|
4711 |
+
if(is_object($wck_value)){
|
4712 |
+
|
4713 |
+
$vars = array(
|
4714 |
+
'{ID}'=> isset($wck_value->ID) ? $wck_value->ID : '',
|
4715 |
+
'{user_login}'=> isset($wck_value->user_login) ? $wck_value->user_login : '',
|
4716 |
+
'{user_nicename}'=> isset($wck_value->user_nicename) ? $wck_value->user_nicename : '',
|
4717 |
+
'{user_email}'=> isset($wck_value->user_email) ? $wck_value->user_email : '',
|
4718 |
+
'{user_url}'=> isset($wck_value->user_url) ? $wck_value->user_url : '',
|
4719 |
+
'{display_name}'=> isset($wck_value->display_name) ? $wck_value->display_name : '',
|
4720 |
+
'{user_posts_url}'=> get_author_posts_url($wck_value->ID),
|
4721 |
+
'{user_avtar}'=> get_avatar($wck_value->ID),
|
4722 |
+
|
4723 |
+
|
4724 |
+
);
|
4725 |
+
|
4726 |
+
$html = strtr($wrapper_html, $vars);
|
4727 |
+
|
4728 |
+
|
4729 |
+
}
|
4730 |
+
elseif (is_array($wck_value)){
|
4731 |
+
|
4732 |
+
}else{
|
4733 |
+
$html = sprintf($wrapper_html, $wck_value);
|
4734 |
+
}
|
4735 |
+
|
4736 |
+
?>
|
4737 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_user ">
|
4738 |
+
<?php echo ($html); ?>
|
4739 |
+
</div>
|
4740 |
+
<?php
|
4741 |
+
endif;
|
4742 |
+
|
4743 |
+
}
|
4744 |
+
|
4745 |
+
|
4746 |
+
|
4747 |
+
add_action('post_grid_layout_element_css_wck_user', 'post_grid_layout_element_css_wck_user', 10);
|
4748 |
+
function post_grid_layout_element_css_wck_user($args){
|
4749 |
+
|
4750 |
+
|
4751 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
4752 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4753 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
4754 |
+
|
4755 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
4756 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
4757 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
4758 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
4759 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
4760 |
+
|
4761 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
4762 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
4763 |
+
|
4764 |
+
?>
|
4765 |
+
<style type="text/css">
|
4766 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
4767 |
+
<?php if(!empty($color)): ?>
|
4768 |
+
color: <?php echo $color; ?>;
|
4769 |
+
<?php endif; ?>
|
4770 |
+
<?php if(!empty($font_size)): ?>
|
4771 |
+
font-size: <?php echo $font_size; ?>;
|
4772 |
+
<?php endif; ?>
|
4773 |
+
<?php if(!empty($font_family)): ?>
|
4774 |
+
font-family: <?php echo $font_family; ?>;
|
4775 |
+
<?php endif; ?>
|
4776 |
+
<?php if(!empty($margin)): ?>
|
4777 |
+
margin: <?php echo $margin; ?>;
|
4778 |
+
<?php endif; ?>
|
4779 |
+
<?php if(!empty($text_align)): ?>
|
4780 |
+
text-align: <?php echo $text_align; ?>;
|
4781 |
+
<?php endif; ?>
|
4782 |
+
<?php if(!empty($css)): ?>
|
4783 |
+
<?php echo $css; ?>
|
4784 |
+
<?php endif; ?>
|
4785 |
+
}
|
4786 |
+
<?php if(!empty($css_hover)): ?>
|
4787 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
4788 |
+
<?php echo $css_hover; ?>
|
4789 |
+
}
|
4790 |
+
<?php endif; ?>
|
4791 |
+
</style>
|
4792 |
+
<?php
|
4793 |
+
}
|
4794 |
+
|
4795 |
+
|
4796 |
+
|
4797 |
+
|
4798 |
+
add_action('post_grid_layout_element_option_wck_date_picker','post_grid_layout_element_option_wck_date_picker');
|
4799 |
+
function post_grid_layout_element_option_wck_date_picker($parameters){
|
4800 |
+
|
4801 |
+
$settings_tabs_field = new settings_tabs_field();
|
4802 |
+
|
4803 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4804 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4805 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4806 |
+
|
4807 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
4808 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
4809 |
+
|
4810 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4811 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4812 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4813 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4814 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4815 |
+
|
4816 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
4817 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
4818 |
+
|
4819 |
+
|
4820 |
+
|
4821 |
+
?>
|
4822 |
+
<div class="item">
|
4823 |
+
<div class="element-title header ">
|
4824 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4825 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4826 |
+
|
4827 |
+
<span class="expand"><?php echo __('WCK Date picker','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
4828 |
+
</div>
|
4829 |
+
<div class="element-options options">
|
4830 |
+
|
4831 |
+
<?php
|
4832 |
+
|
4833 |
+
$args = array(
|
4834 |
+
'id' => 'wck_key',
|
4835 |
+
'css_id' => $element_index.'_text',
|
4836 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4837 |
+
'title' => __('WCK key','post-grid'),
|
4838 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
4839 |
+
'type' => 'text',
|
4840 |
+
'value' => $wck_key,
|
4841 |
+
'default' => '',
|
4842 |
+
'placeholder' => '',
|
4843 |
+
);
|
4844 |
+
|
4845 |
+
$settings_tabs_field->generate_field($args);
|
4846 |
+
|
4847 |
+
$args = array(
|
4848 |
+
'id' => 'wrapper_html',
|
4849 |
+
'css_id' => $element_index.'_wrapper_html',
|
4850 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4851 |
+
'title' => __('Wrapper html','post-grid'),
|
4852 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Date: %s</code>','post-grid'),
|
4853 |
+
'type' => 'text',
|
4854 |
+
'value' => $wrapper_html,
|
4855 |
+
'default' => '',
|
4856 |
+
'placeholder' => 'Value: %s',
|
4857 |
+
);
|
4858 |
+
|
4859 |
+
$settings_tabs_field->generate_field($args);
|
4860 |
+
|
4861 |
+
$args = array(
|
4862 |
+
'id' => 'color',
|
4863 |
+
'css_id' => $element_index.'_wck_date_picker',
|
4864 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4865 |
+
'title' => __('Color','post-grid'),
|
4866 |
+
'details' => __('Title text color.','post-grid'),
|
4867 |
+
'type' => 'colorpicker',
|
4868 |
+
'value' => $color,
|
4869 |
+
'default' => '',
|
4870 |
+
);
|
4871 |
+
|
4872 |
+
$settings_tabs_field->generate_field($args);
|
4873 |
+
|
4874 |
+
$args = array(
|
4875 |
+
'id' => 'font_size',
|
4876 |
+
'css_id' => $element_index.'_font_size',
|
4877 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4878 |
+
'title' => __('Font size','post-grid'),
|
4879 |
+
'details' => __('Set font size.','post-grid'),
|
4880 |
+
'type' => 'text',
|
4881 |
+
'value' => $font_size,
|
4882 |
+
'default' => '',
|
4883 |
+
'placeholder' => '14px',
|
4884 |
+
);
|
4885 |
+
|
4886 |
+
$settings_tabs_field->generate_field($args);
|
4887 |
+
|
4888 |
+
|
4889 |
+
$args = array(
|
4890 |
+
'id' => 'font_family',
|
4891 |
+
'css_id' => $element_index.'_font_family',
|
4892 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4893 |
+
'title' => __('Font family','post-grid'),
|
4894 |
+
'details' => __('Set font family.','post-grid'),
|
4895 |
+
'type' => 'text',
|
4896 |
+
'value' => $font_family,
|
4897 |
+
'default' => '',
|
4898 |
+
'placeholder' => 'Open Sans',
|
4899 |
+
);
|
4900 |
+
|
4901 |
+
$settings_tabs_field->generate_field($args);
|
4902 |
+
|
4903 |
+
|
4904 |
+
$args = array(
|
4905 |
+
'id' => 'margin',
|
4906 |
+
'css_id' => $element_index.'_margin',
|
4907 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4908 |
+
'title' => __('Margin','post-grid'),
|
4909 |
+
'details' => __('Set margin.','post-grid'),
|
4910 |
+
'type' => 'text',
|
4911 |
+
'value' => $margin,
|
4912 |
+
'default' => '',
|
4913 |
+
'placeholder' => '5px 0',
|
4914 |
+
);
|
4915 |
+
|
4916 |
+
$settings_tabs_field->generate_field($args);
|
4917 |
+
|
4918 |
+
|
4919 |
+
$args = array(
|
4920 |
+
'id' => 'text_align',
|
4921 |
+
'css_id' => $element_index.'_text_align',
|
4922 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4923 |
+
'title' => __('Text align','post-grid'),
|
4924 |
+
'details' => __('Choose text align.','post-grid'),
|
4925 |
+
'type' => 'select',
|
4926 |
+
'value' => $text_align,
|
4927 |
+
'default' => 'left',
|
4928 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
4929 |
+
);
|
4930 |
+
|
4931 |
+
$settings_tabs_field->generate_field($args);
|
4932 |
+
|
4933 |
+
|
4934 |
+
$args = array(
|
4935 |
+
'id' => 'css',
|
4936 |
+
'css_id' => $element_index.'_css',
|
4937 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4938 |
+
'title' => __('Custom CSS','post-grid'),
|
4939 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
4940 |
+
'type' => 'textarea',
|
4941 |
+
'value' => $css,
|
4942 |
+
'default' => '',
|
4943 |
+
'placeholder' => '',
|
4944 |
+
);
|
4945 |
+
|
4946 |
+
$settings_tabs_field->generate_field($args);
|
4947 |
+
|
4948 |
+
$args = array(
|
4949 |
+
'id' => 'css_hover',
|
4950 |
+
'css_id' => $element_index.'_css_hover',
|
4951 |
+
'parent' => $input_name.'[wck_date_picker]',
|
4952 |
+
'title' => __('Hover CSS','post-grid'),
|
4953 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
4954 |
+
'type' => 'textarea',
|
4955 |
+
'value' => $css_hover,
|
4956 |
+
'default' => '',
|
4957 |
+
'placeholder' => '',
|
4958 |
+
);
|
4959 |
+
|
4960 |
+
$settings_tabs_field->generate_field($args);
|
4961 |
+
|
4962 |
+
|
4963 |
+
ob_start();
|
4964 |
+
?>
|
4965 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
4966 |
+
<?php
|
4967 |
+
|
4968 |
+
$html = ob_get_clean();
|
4969 |
+
|
4970 |
+
$args = array(
|
4971 |
+
'id' => 'use_css',
|
4972 |
+
'title' => __('Use of CSS','post-grid'),
|
4973 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
4974 |
+
'type' => 'custom_html',
|
4975 |
+
'html' => $html,
|
4976 |
+
|
4977 |
+
);
|
4978 |
+
|
4979 |
+
$settings_tabs_field->generate_field($args);
|
4980 |
+
|
4981 |
+
?>
|
4982 |
+
|
4983 |
+
</div>
|
4984 |
+
</div>
|
4985 |
+
<?php
|
4986 |
+
|
4987 |
+
}
|
4988 |
+
|
4989 |
+
|
4990 |
+
|
4991 |
+
add_action('post_grid_layout_element_wck_date_picker', 'post_grid_layout_element_wck_date_picker');
|
4992 |
+
function post_grid_layout_element_wck_date_picker($args){
|
4993 |
+
|
4994 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
4995 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
4996 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
4997 |
+
|
4998 |
+
if(empty($post_id)) return;
|
4999 |
+
|
5000 |
+
$title = get_the_title($post_id);
|
5001 |
+
|
5002 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
5003 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
5004 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
5005 |
+
|
5006 |
+
|
5007 |
+
|
5008 |
+
//var_dump($wck_key);
|
5009 |
+
|
5010 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
5011 |
+
|
5012 |
+
if(!empty($wck_value)):
|
5013 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
5014 |
+
?>
|
5015 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_date_picker ">
|
5016 |
+
<?php echo ($wck_value); ?>
|
5017 |
+
</div>
|
5018 |
+
<?php
|
5019 |
+
endif;
|
5020 |
+
|
5021 |
+
}
|
5022 |
+
|
5023 |
+
|
5024 |
+
|
5025 |
+
add_action('post_grid_layout_element_css_wck_date_picker', 'post_grid_layout_element_css_wck_date_picker', 10);
|
5026 |
+
function post_grid_layout_element_css_wck_date_picker($args){
|
5027 |
+
|
5028 |
+
|
5029 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
5030 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5031 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
5032 |
+
|
5033 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
5034 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
5035 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
5036 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
5037 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
5038 |
+
|
5039 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
5040 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
5041 |
+
|
5042 |
+
?>
|
5043 |
+
<style type="text/css">
|
5044 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
5045 |
+
<?php if(!empty($color)): ?>
|
5046 |
+
color: <?php echo $color; ?>;
|
5047 |
+
<?php endif; ?>
|
5048 |
+
<?php if(!empty($font_size)): ?>
|
5049 |
+
font-size: <?php echo $font_size; ?>;
|
5050 |
+
<?php endif; ?>
|
5051 |
+
<?php if(!empty($font_family)): ?>
|
5052 |
+
font-family: <?php echo $font_family; ?>;
|
5053 |
+
<?php endif; ?>
|
5054 |
+
<?php if(!empty($margin)): ?>
|
5055 |
+
margin: <?php echo $margin; ?>;
|
5056 |
+
<?php endif; ?>
|
5057 |
+
<?php if(!empty($text_align)): ?>
|
5058 |
+
text-align: <?php echo $text_align; ?>;
|
5059 |
+
<?php endif; ?>
|
5060 |
+
<?php if(!empty($css)): ?>
|
5061 |
+
<?php echo $css; ?>
|
5062 |
+
<?php endif; ?>
|
5063 |
+
}
|
5064 |
+
<?php if(!empty($css_hover)): ?>
|
5065 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
5066 |
+
<?php echo $css_hover; ?>
|
5067 |
+
}
|
5068 |
+
<?php endif; ?>
|
5069 |
+
</style>
|
5070 |
+
<?php
|
5071 |
+
}
|
5072 |
+
|
5073 |
+
|
5074 |
+
|
5075 |
+
|
5076 |
+
|
5077 |
+
add_action('post_grid_layout_element_option_wck_time_picker','post_grid_layout_element_option_wck_time_picker');
|
5078 |
+
function post_grid_layout_element_option_wck_time_picker($parameters){
|
5079 |
+
|
5080 |
+
$settings_tabs_field = new settings_tabs_field();
|
5081 |
+
|
5082 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
5083 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
5084 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
5085 |
+
|
5086 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
5087 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
5088 |
+
|
5089 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
5090 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
5091 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
5092 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
5093 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
5094 |
+
|
5095 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
5096 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
5097 |
+
|
5098 |
+
|
5099 |
+
|
5100 |
+
?>
|
5101 |
+
<div class="item">
|
5102 |
+
<div class="element-title header ">
|
5103 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
5104 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
5105 |
+
|
5106 |
+
<span class="expand"><?php echo __('WCK Time picker','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
5107 |
+
</div>
|
5108 |
+
<div class="element-options options">
|
5109 |
+
|
5110 |
+
<?php
|
5111 |
+
|
5112 |
+
$args = array(
|
5113 |
+
'id' => 'wck_key',
|
5114 |
+
'css_id' => $element_index.'_text',
|
5115 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5116 |
+
'title' => __('WCK key','post-grid'),
|
5117 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
5118 |
+
'type' => 'text',
|
5119 |
+
'value' => $wck_key,
|
5120 |
+
'default' => '',
|
5121 |
+
'placeholder' => '',
|
5122 |
+
);
|
5123 |
+
|
5124 |
+
$settings_tabs_field->generate_field($args);
|
5125 |
+
|
5126 |
+
$args = array(
|
5127 |
+
'id' => 'wrapper_html',
|
5128 |
+
'css_id' => $element_index.'_wrapper_html',
|
5129 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5130 |
+
'title' => __('Wrapper html','post-grid'),
|
5131 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Date: %s</code>','post-grid'),
|
5132 |
+
'type' => 'text',
|
5133 |
+
'value' => $wrapper_html,
|
5134 |
+
'default' => '',
|
5135 |
+
'placeholder' => 'Value: %s',
|
5136 |
+
);
|
5137 |
+
|
5138 |
+
$settings_tabs_field->generate_field($args);
|
5139 |
+
|
5140 |
+
|
5141 |
+
$args = array(
|
5142 |
+
'id' => 'color',
|
5143 |
+
'css_id' => $element_index.'_wck_time_picker',
|
5144 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5145 |
+
'title' => __('Color','post-grid'),
|
5146 |
+
'details' => __('Title text color.','post-grid'),
|
5147 |
+
'type' => 'colorpicker',
|
5148 |
+
'value' => $color,
|
5149 |
+
'default' => '',
|
5150 |
+
);
|
5151 |
+
|
5152 |
+
$settings_tabs_field->generate_field($args);
|
5153 |
+
|
5154 |
+
$args = array(
|
5155 |
+
'id' => 'font_size',
|
5156 |
+
'css_id' => $element_index.'_font_size',
|
5157 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5158 |
+
'title' => __('Font size','post-grid'),
|
5159 |
+
'details' => __('Set font size.','post-grid'),
|
5160 |
+
'type' => 'text',
|
5161 |
+
'value' => $font_size,
|
5162 |
+
'default' => '',
|
5163 |
+
'placeholder' => '14px',
|
5164 |
+
);
|
5165 |
+
|
5166 |
+
$settings_tabs_field->generate_field($args);
|
5167 |
+
|
5168 |
+
|
5169 |
+
$args = array(
|
5170 |
+
'id' => 'font_family',
|
5171 |
+
'css_id' => $element_index.'_font_family',
|
5172 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5173 |
+
'title' => __('Font family','post-grid'),
|
5174 |
+
'details' => __('Set font family.','post-grid'),
|
5175 |
+
'type' => 'text',
|
5176 |
+
'value' => $font_family,
|
5177 |
+
'default' => '',
|
5178 |
+
'placeholder' => 'Open Sans',
|
5179 |
+
);
|
5180 |
+
|
5181 |
+
$settings_tabs_field->generate_field($args);
|
5182 |
+
|
5183 |
+
|
5184 |
+
$args = array(
|
5185 |
+
'id' => 'margin',
|
5186 |
+
'css_id' => $element_index.'_margin',
|
5187 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5188 |
+
'title' => __('Margin','post-grid'),
|
5189 |
+
'details' => __('Set margin.','post-grid'),
|
5190 |
+
'type' => 'text',
|
5191 |
+
'value' => $margin,
|
5192 |
+
'default' => '',
|
5193 |
+
'placeholder' => '5px 0',
|
5194 |
+
);
|
5195 |
+
|
5196 |
+
$settings_tabs_field->generate_field($args);
|
5197 |
+
|
5198 |
+
|
5199 |
+
$args = array(
|
5200 |
+
'id' => 'text_align',
|
5201 |
+
'css_id' => $element_index.'_text_align',
|
5202 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5203 |
+
'title' => __('Text align','post-grid'),
|
5204 |
+
'details' => __('Choose text align.','post-grid'),
|
5205 |
+
'type' => 'select',
|
5206 |
+
'value' => $text_align,
|
5207 |
+
'default' => 'left',
|
5208 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
5209 |
+
);
|
5210 |
+
|
5211 |
+
$settings_tabs_field->generate_field($args);
|
5212 |
+
|
5213 |
+
|
5214 |
+
$args = array(
|
5215 |
+
'id' => 'css',
|
5216 |
+
'css_id' => $element_index.'_css',
|
5217 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5218 |
+
'title' => __('Custom CSS','post-grid'),
|
5219 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
5220 |
+
'type' => 'textarea',
|
5221 |
+
'value' => $css,
|
5222 |
+
'default' => '',
|
5223 |
+
'placeholder' => '',
|
5224 |
+
);
|
5225 |
+
|
5226 |
+
$settings_tabs_field->generate_field($args);
|
5227 |
+
|
5228 |
+
$args = array(
|
5229 |
+
'id' => 'css_hover',
|
5230 |
+
'css_id' => $element_index.'_css_hover',
|
5231 |
+
'parent' => $input_name.'[wck_time_picker]',
|
5232 |
+
'title' => __('Hover CSS','post-grid'),
|
5233 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
5234 |
+
'type' => 'textarea',
|
5235 |
+
'value' => $css_hover,
|
5236 |
+
'default' => '',
|
5237 |
+
'placeholder' => '',
|
5238 |
+
);
|
5239 |
+
|
5240 |
+
$settings_tabs_field->generate_field($args);
|
5241 |
+
|
5242 |
+
|
5243 |
+
ob_start();
|
5244 |
+
?>
|
5245 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
5246 |
+
<?php
|
5247 |
+
|
5248 |
+
$html = ob_get_clean();
|
5249 |
+
|
5250 |
+
$args = array(
|
5251 |
+
'id' => 'use_css',
|
5252 |
+
'title' => __('Use of CSS','post-grid'),
|
5253 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
5254 |
+
'type' => 'custom_html',
|
5255 |
+
'html' => $html,
|
5256 |
+
|
5257 |
+
);
|
5258 |
+
|
5259 |
+
$settings_tabs_field->generate_field($args);
|
5260 |
+
|
5261 |
+
?>
|
5262 |
+
|
5263 |
+
</div>
|
5264 |
+
</div>
|
5265 |
+
<?php
|
5266 |
+
|
5267 |
+
}
|
5268 |
+
|
5269 |
+
|
5270 |
+
|
5271 |
+
add_action('post_grid_layout_element_wck_time_picker', 'post_grid_layout_element_wck_time_picker');
|
5272 |
+
function post_grid_layout_element_wck_time_picker($args){
|
5273 |
+
|
5274 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5275 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
5276 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
5277 |
+
|
5278 |
+
if(empty($post_id)) return;
|
5279 |
+
|
5280 |
+
$title = get_the_title($post_id);
|
5281 |
+
|
5282 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
5283 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
5284 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
5285 |
+
|
5286 |
+
|
5287 |
+
|
5288 |
+
//var_dump($wck_key);
|
5289 |
+
|
5290 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
5291 |
+
|
5292 |
+
if(!empty($wck_value)):
|
5293 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
5294 |
+
|
5295 |
+
?>
|
5296 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_time_picker ">
|
5297 |
+
<?php echo ($wck_value); ?>
|
5298 |
+
</div>
|
5299 |
+
<?php
|
5300 |
+
endif;
|
5301 |
+
|
5302 |
+
}
|
5303 |
+
|
5304 |
+
|
5305 |
+
|
5306 |
+
add_action('post_grid_layout_element_css_wck_time_picker', 'post_grid_layout_element_css_wck_time_picker', 10);
|
5307 |
+
function post_grid_layout_element_css_wck_time_picker($args){
|
5308 |
+
|
5309 |
+
|
5310 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
5311 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5312 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
5313 |
+
|
5314 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
5315 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
5316 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
5317 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
5318 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
5319 |
+
|
5320 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
5321 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
5322 |
+
|
5323 |
+
?>
|
5324 |
+
<style type="text/css">
|
5325 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
5326 |
+
<?php if(!empty($color)): ?>
|
5327 |
+
color: <?php echo $color; ?>;
|
5328 |
+
<?php endif; ?>
|
5329 |
+
<?php if(!empty($font_size)): ?>
|
5330 |
+
font-size: <?php echo $font_size; ?>;
|
5331 |
+
<?php endif; ?>
|
5332 |
+
<?php if(!empty($font_family)): ?>
|
5333 |
+
font-family: <?php echo $font_family; ?>;
|
5334 |
+
<?php endif; ?>
|
5335 |
+
<?php if(!empty($margin)): ?>
|
5336 |
+
margin: <?php echo $margin; ?>;
|
5337 |
+
<?php endif; ?>
|
5338 |
+
<?php if(!empty($text_align)): ?>
|
5339 |
+
text-align: <?php echo $text_align; ?>;
|
5340 |
+
<?php endif; ?>
|
5341 |
+
<?php if(!empty($css)): ?>
|
5342 |
+
<?php echo $css; ?>
|
5343 |
+
<?php endif; ?>
|
5344 |
+
}
|
5345 |
+
<?php if(!empty($css_hover)): ?>
|
5346 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
5347 |
+
<?php echo $css_hover; ?>
|
5348 |
+
}
|
5349 |
+
<?php endif; ?>
|
5350 |
+
</style>
|
5351 |
+
<?php
|
5352 |
+
}
|
5353 |
+
|
5354 |
+
|
5355 |
+
|
5356 |
+
|
5357 |
+
add_action('post_grid_layout_element_option_wck_datetime_picker','post_grid_layout_element_option_wck_datetime_picker');
|
5358 |
+
function post_grid_layout_element_option_wck_datetime_picker($parameters){
|
5359 |
+
|
5360 |
+
$settings_tabs_field = new settings_tabs_field();
|
5361 |
+
|
5362 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
5363 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
5364 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
5365 |
+
|
5366 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
5367 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
5368 |
+
|
5369 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
5370 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
5371 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
5372 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
5373 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
5374 |
+
|
5375 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
5376 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
5377 |
+
|
5378 |
+
|
5379 |
+
|
5380 |
+
?>
|
5381 |
+
<div class="item">
|
5382 |
+
<div class="element-title header ">
|
5383 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
5384 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
5385 |
+
|
5386 |
+
<span class="expand"><?php echo __('WCK Datetime picker','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
5387 |
+
</div>
|
5388 |
+
<div class="element-options options">
|
5389 |
+
|
5390 |
+
<?php
|
5391 |
+
|
5392 |
+
$args = array(
|
5393 |
+
'id' => 'wck_key',
|
5394 |
+
'css_id' => $element_index.'_text',
|
5395 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5396 |
+
'title' => __('WCK key','post-grid'),
|
5397 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
5398 |
+
'type' => 'text',
|
5399 |
+
'value' => $wck_key,
|
5400 |
+
'default' => '',
|
5401 |
+
'placeholder' => '',
|
5402 |
+
);
|
5403 |
+
|
5404 |
+
$settings_tabs_field->generate_field($args);
|
5405 |
+
|
5406 |
+
$args = array(
|
5407 |
+
'id' => 'wrapper_html',
|
5408 |
+
'css_id' => $element_index.'_wrapper_html',
|
5409 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5410 |
+
'title' => __('Wrapper html','post-grid'),
|
5411 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Date: %s</code>','post-grid'),
|
5412 |
+
'type' => 'text',
|
5413 |
+
'value' => $wrapper_html,
|
5414 |
+
'default' => '',
|
5415 |
+
'placeholder' => 'Value: %s',
|
5416 |
+
);
|
5417 |
+
|
5418 |
+
$settings_tabs_field->generate_field($args);
|
5419 |
+
|
5420 |
+
|
5421 |
+
$args = array(
|
5422 |
+
'id' => 'color',
|
5423 |
+
'css_id' => $element_index.'_wck_datetime_picker',
|
5424 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5425 |
+
'title' => __('Color','post-grid'),
|
5426 |
+
'details' => __('Title text color.','post-grid'),
|
5427 |
+
'type' => 'colorpicker',
|
5428 |
+
'value' => $color,
|
5429 |
+
'default' => '',
|
5430 |
+
);
|
5431 |
+
|
5432 |
+
$settings_tabs_field->generate_field($args);
|
5433 |
+
|
5434 |
+
$args = array(
|
5435 |
+
'id' => 'font_size',
|
5436 |
+
'css_id' => $element_index.'_font_size',
|
5437 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5438 |
+
'title' => __('Font size','post-grid'),
|
5439 |
+
'details' => __('Set font size.','post-grid'),
|
5440 |
+
'type' => 'text',
|
5441 |
+
'value' => $font_size,
|
5442 |
+
'default' => '',
|
5443 |
+
'placeholder' => '14px',
|
5444 |
+
);
|
5445 |
+
|
5446 |
+
$settings_tabs_field->generate_field($args);
|
5447 |
+
|
5448 |
+
|
5449 |
+
$args = array(
|
5450 |
+
'id' => 'font_family',
|
5451 |
+
'css_id' => $element_index.'_font_family',
|
5452 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5453 |
+
'title' => __('Font family','post-grid'),
|
5454 |
+
'details' => __('Set font family.','post-grid'),
|
5455 |
+
'type' => 'text',
|
5456 |
+
'value' => $font_family,
|
5457 |
+
'default' => '',
|
5458 |
+
'placeholder' => 'Open Sans',
|
5459 |
+
);
|
5460 |
+
|
5461 |
+
$settings_tabs_field->generate_field($args);
|
5462 |
+
|
5463 |
+
|
5464 |
+
$args = array(
|
5465 |
+
'id' => 'margin',
|
5466 |
+
'css_id' => $element_index.'_margin',
|
5467 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5468 |
+
'title' => __('Margin','post-grid'),
|
5469 |
+
'details' => __('Set margin.','post-grid'),
|
5470 |
+
'type' => 'text',
|
5471 |
+
'value' => $margin,
|
5472 |
+
'default' => '',
|
5473 |
+
'placeholder' => '5px 0',
|
5474 |
+
);
|
5475 |
+
|
5476 |
+
$settings_tabs_field->generate_field($args);
|
5477 |
+
|
5478 |
+
|
5479 |
+
$args = array(
|
5480 |
+
'id' => 'text_align',
|
5481 |
+
'css_id' => $element_index.'_text_align',
|
5482 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5483 |
+
'title' => __('Text align','post-grid'),
|
5484 |
+
'details' => __('Choose text align.','post-grid'),
|
5485 |
+
'type' => 'select',
|
5486 |
+
'value' => $text_align,
|
5487 |
+
'default' => 'left',
|
5488 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
5489 |
+
);
|
5490 |
+
|
5491 |
+
$settings_tabs_field->generate_field($args);
|
5492 |
+
|
5493 |
+
|
5494 |
+
$args = array(
|
5495 |
+
'id' => 'css',
|
5496 |
+
'css_id' => $element_index.'_css',
|
5497 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5498 |
+
'title' => __('Custom CSS','post-grid'),
|
5499 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
5500 |
+
'type' => 'textarea',
|
5501 |
+
'value' => $css,
|
5502 |
+
'default' => '',
|
5503 |
+
'placeholder' => '',
|
5504 |
+
);
|
5505 |
+
|
5506 |
+
$settings_tabs_field->generate_field($args);
|
5507 |
+
|
5508 |
+
$args = array(
|
5509 |
+
'id' => 'css_hover',
|
5510 |
+
'css_id' => $element_index.'_css_hover',
|
5511 |
+
'parent' => $input_name.'[wck_datetime_picker]',
|
5512 |
+
'title' => __('Hover CSS','post-grid'),
|
5513 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
5514 |
+
'type' => 'textarea',
|
5515 |
+
'value' => $css_hover,
|
5516 |
+
'default' => '',
|
5517 |
+
'placeholder' => '',
|
5518 |
+
);
|
5519 |
+
|
5520 |
+
$settings_tabs_field->generate_field($args);
|
5521 |
+
|
5522 |
+
|
5523 |
+
ob_start();
|
5524 |
+
?>
|
5525 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
5526 |
+
<?php
|
5527 |
+
|
5528 |
+
$html = ob_get_clean();
|
5529 |
+
|
5530 |
+
$args = array(
|
5531 |
+
'id' => 'use_css',
|
5532 |
+
'title' => __('Use of CSS','post-grid'),
|
5533 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
5534 |
+
'type' => 'custom_html',
|
5535 |
+
'html' => $html,
|
5536 |
+
|
5537 |
+
);
|
5538 |
+
|
5539 |
+
$settings_tabs_field->generate_field($args);
|
5540 |
+
|
5541 |
+
?>
|
5542 |
+
|
5543 |
+
</div>
|
5544 |
+
</div>
|
5545 |
+
<?php
|
5546 |
+
|
5547 |
+
}
|
5548 |
+
|
5549 |
+
|
5550 |
+
|
5551 |
+
add_action('post_grid_layout_element_wck_datetime_picker', 'post_grid_layout_element_wck_datetime_picker');
|
5552 |
+
function post_grid_layout_element_wck_datetime_picker($args){
|
5553 |
+
|
5554 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5555 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
5556 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
5557 |
+
|
5558 |
+
if(empty($post_id)) return;
|
5559 |
+
|
5560 |
+
$title = get_the_title($post_id);
|
5561 |
+
|
5562 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
5563 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
5564 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
5565 |
+
|
5566 |
+
|
5567 |
+
|
5568 |
+
//var_dump($wck_key);
|
5569 |
+
|
5570 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
5571 |
+
|
5572 |
+
if(!empty($wck_value)):
|
5573 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
5574 |
+
|
5575 |
+
?>
|
5576 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_datetime_picker ">
|
5577 |
+
<?php echo esc_html($wck_value); ?>
|
5578 |
+
</div>
|
5579 |
+
<?php
|
5580 |
+
endif;
|
5581 |
+
|
5582 |
+
}
|
5583 |
+
|
5584 |
+
|
5585 |
+
|
5586 |
+
add_action('post_grid_layout_element_css_wck_datetime_picker', 'post_grid_layout_element_css_wck_datetime_picker', 10);
|
5587 |
+
function post_grid_layout_element_css_wck_datetime_picker($args){
|
5588 |
+
|
5589 |
+
|
5590 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
5591 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5592 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
5593 |
+
|
5594 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
5595 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
5596 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
5597 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
5598 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
5599 |
+
|
5600 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
5601 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
5602 |
+
|
5603 |
+
?>
|
5604 |
+
<style type="text/css">
|
5605 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
5606 |
+
<?php if(!empty($color)): ?>
|
5607 |
+
color: <?php echo $color; ?>;
|
5608 |
+
<?php endif; ?>
|
5609 |
+
<?php if(!empty($font_size)): ?>
|
5610 |
+
font-size: <?php echo $font_size; ?>;
|
5611 |
+
<?php endif; ?>
|
5612 |
+
<?php if(!empty($font_family)): ?>
|
5613 |
+
font-family: <?php echo $font_family; ?>;
|
5614 |
+
<?php endif; ?>
|
5615 |
+
<?php if(!empty($margin)): ?>
|
5616 |
+
margin: <?php echo $margin; ?>;
|
5617 |
+
<?php endif; ?>
|
5618 |
+
<?php if(!empty($text_align)): ?>
|
5619 |
+
text-align: <?php echo $text_align; ?>;
|
5620 |
+
<?php endif; ?>
|
5621 |
+
<?php if(!empty($css)): ?>
|
5622 |
+
<?php echo $css; ?>
|
5623 |
+
<?php endif; ?>
|
5624 |
+
}
|
5625 |
+
<?php if(!empty($css_hover)): ?>
|
5626 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
5627 |
+
<?php echo $css_hover; ?>
|
5628 |
+
}
|
5629 |
+
<?php endif; ?>
|
5630 |
+
</style>
|
5631 |
+
<?php
|
5632 |
+
}
|
5633 |
+
|
5634 |
+
|
5635 |
+
add_action('post_grid_layout_element_option_wck_google_map','post_grid_layout_element_option_wck_google_map');
|
5636 |
+
function post_grid_layout_element_option_wck_google_map($parameters){
|
5637 |
+
|
5638 |
+
$settings_tabs_field = new settings_tabs_field();
|
5639 |
+
|
5640 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
5641 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
5642 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
5643 |
+
|
5644 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
5645 |
+
|
5646 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
5647 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
5648 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
5649 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
5650 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
5651 |
+
|
5652 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
5653 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
5654 |
+
|
5655 |
+
|
5656 |
+
|
5657 |
+
?>
|
5658 |
+
<div class="item">
|
5659 |
+
<div class="element-title header ">
|
5660 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
5661 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
5662 |
+
|
5663 |
+
<span class="expand"><?php echo __('WCK Google map','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
5664 |
+
</div>
|
5665 |
+
<div class="element-options options">
|
5666 |
+
|
5667 |
+
<?php
|
5668 |
+
|
5669 |
+
$args = array(
|
5670 |
+
'id' => 'wck_key',
|
5671 |
+
'css_id' => $element_index.'_text',
|
5672 |
+
'parent' => $input_name.'[wck_google_map]',
|
5673 |
+
'title' => __('WCK key','post-grid'),
|
5674 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
5675 |
+
'type' => 'text',
|
5676 |
+
'value' => $wck_key,
|
5677 |
+
'default' => '',
|
5678 |
+
'placeholder' => '',
|
5679 |
+
);
|
5680 |
+
|
5681 |
+
$settings_tabs_field->generate_field($args);
|
5682 |
+
|
5683 |
+
$args = array(
|
5684 |
+
'id' => 'color',
|
5685 |
+
'css_id' => $element_index.'_wck_google_map',
|
5686 |
+
'parent' => $input_name.'[wck_google_map]',
|
5687 |
+
'title' => __('Color','post-grid'),
|
5688 |
+
'details' => __('Title text color.','post-grid'),
|
5689 |
+
'type' => 'colorpicker',
|
5690 |
+
'value' => $color,
|
5691 |
+
'default' => '',
|
5692 |
+
);
|
5693 |
+
|
5694 |
+
$settings_tabs_field->generate_field($args);
|
5695 |
+
|
5696 |
+
$args = array(
|
5697 |
+
'id' => 'font_size',
|
5698 |
+
'css_id' => $element_index.'_font_size',
|
5699 |
+
'parent' => $input_name.'[wck_google_map]',
|
5700 |
+
'title' => __('Font size','post-grid'),
|
5701 |
+
'details' => __('Set font size.','post-grid'),
|
5702 |
+
'type' => 'text',
|
5703 |
+
'value' => $font_size,
|
5704 |
+
'default' => '',
|
5705 |
+
'placeholder' => '14px',
|
5706 |
+
);
|
5707 |
+
|
5708 |
+
$settings_tabs_field->generate_field($args);
|
5709 |
+
|
5710 |
+
|
5711 |
+
$args = array(
|
5712 |
+
'id' => 'font_family',
|
5713 |
+
'css_id' => $element_index.'_font_family',
|
5714 |
+
'parent' => $input_name.'[wck_google_map]',
|
5715 |
+
'title' => __('Font family','post-grid'),
|
5716 |
+
'details' => __('Set font family.','post-grid'),
|
5717 |
+
'type' => 'text',
|
5718 |
+
'value' => $font_family,
|
5719 |
+
'default' => '',
|
5720 |
+
'placeholder' => 'Open Sans',
|
5721 |
+
);
|
5722 |
+
|
5723 |
+
$settings_tabs_field->generate_field($args);
|
5724 |
+
|
5725 |
+
|
5726 |
+
$args = array(
|
5727 |
+
'id' => 'margin',
|
5728 |
+
'css_id' => $element_index.'_margin',
|
5729 |
+
'parent' => $input_name.'[wck_google_map]',
|
5730 |
+
'title' => __('Margin','post-grid'),
|
5731 |
+
'details' => __('Set margin.','post-grid'),
|
5732 |
+
'type' => 'text',
|
5733 |
+
'value' => $margin,
|
5734 |
+
'default' => '',
|
5735 |
+
'placeholder' => '5px 0',
|
5736 |
+
);
|
5737 |
+
|
5738 |
+
$settings_tabs_field->generate_field($args);
|
5739 |
+
|
5740 |
+
|
5741 |
+
$args = array(
|
5742 |
+
'id' => 'text_align',
|
5743 |
+
'css_id' => $element_index.'_text_align',
|
5744 |
+
'parent' => $input_name.'[wck_google_map]',
|
5745 |
+
'title' => __('Text align','post-grid'),
|
5746 |
+
'details' => __('Choose text align.','post-grid'),
|
5747 |
+
'type' => 'select',
|
5748 |
+
'value' => $text_align,
|
5749 |
+
'default' => 'left',
|
5750 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
5751 |
+
);
|
5752 |
+
|
5753 |
+
$settings_tabs_field->generate_field($args);
|
5754 |
+
|
5755 |
+
|
5756 |
+
$args = array(
|
5757 |
+
'id' => 'css',
|
5758 |
+
'css_id' => $element_index.'_css',
|
5759 |
+
'parent' => $input_name.'[wck_google_map]',
|
5760 |
+
'title' => __('Custom CSS','post-grid'),
|
5761 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
5762 |
+
'type' => 'textarea',
|
5763 |
+
'value' => $css,
|
5764 |
+
'default' => '',
|
5765 |
+
'placeholder' => '',
|
5766 |
+
);
|
5767 |
+
|
5768 |
+
$settings_tabs_field->generate_field($args);
|
5769 |
+
|
5770 |
+
$args = array(
|
5771 |
+
'id' => 'css_hover',
|
5772 |
+
'css_id' => $element_index.'_css_hover',
|
5773 |
+
'parent' => $input_name.'[wck_google_map]',
|
5774 |
+
'title' => __('Hover CSS','post-grid'),
|
5775 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
5776 |
+
'type' => 'textarea',
|
5777 |
+
'value' => $css_hover,
|
5778 |
+
'default' => '',
|
5779 |
+
'placeholder' => '',
|
5780 |
+
);
|
5781 |
+
|
5782 |
+
$settings_tabs_field->generate_field($args);
|
5783 |
+
|
5784 |
+
|
5785 |
+
ob_start();
|
5786 |
+
?>
|
5787 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
5788 |
+
<?php
|
5789 |
+
|
5790 |
+
$html = ob_get_clean();
|
5791 |
+
|
5792 |
+
$args = array(
|
5793 |
+
'id' => 'use_css',
|
5794 |
+
'title' => __('Use of CSS','post-grid'),
|
5795 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
5796 |
+
'type' => 'custom_html',
|
5797 |
+
'html' => $html,
|
5798 |
+
|
5799 |
+
);
|
5800 |
+
|
5801 |
+
$settings_tabs_field->generate_field($args);
|
5802 |
+
|
5803 |
+
?>
|
5804 |
+
|
5805 |
+
</div>
|
5806 |
+
</div>
|
5807 |
+
<?php
|
5808 |
+
|
5809 |
+
}
|
5810 |
+
|
5811 |
+
|
5812 |
+
|
5813 |
+
add_action('post_grid_layout_element_wck_google_map', 'post_grid_layout_element_wck_google_map');
|
5814 |
+
function post_grid_layout_element_wck_google_map($args){
|
5815 |
+
|
5816 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5817 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
5818 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
5819 |
+
|
5820 |
+
if(empty($post_id)) return;
|
5821 |
+
|
5822 |
+
$title = get_the_title($post_id);
|
5823 |
+
|
5824 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
5825 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
5826 |
+
|
5827 |
+
|
5828 |
+
|
5829 |
+
//var_dump($wck_key);
|
5830 |
+
|
5831 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
5832 |
+
|
5833 |
+
if(!empty($wck_value)):
|
5834 |
+
|
5835 |
+
?>
|
5836 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_google_map ">
|
5837 |
+
<?php echo ($wck_value); ?>
|
5838 |
+
</div>
|
5839 |
+
<?php
|
5840 |
+
endif;
|
5841 |
+
|
5842 |
+
}
|
5843 |
+
|
5844 |
+
|
5845 |
+
|
5846 |
+
add_action('post_grid_layout_element_css_wck_google_map', 'post_grid_layout_element_css_wck_google_map', 10);
|
5847 |
+
function post_grid_layout_element_css_wck_google_map($args){
|
5848 |
+
|
5849 |
+
|
5850 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
5851 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
5852 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
5853 |
+
|
5854 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
5855 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
5856 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
5857 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
5858 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
5859 |
+
|
5860 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
5861 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
5862 |
+
|
5863 |
+
?>
|
5864 |
+
<style type="text/css">
|
5865 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
5866 |
+
<?php if(!empty($color)): ?>
|
5867 |
+
color: <?php echo $color; ?>;
|
5868 |
+
<?php endif; ?>
|
5869 |
+
<?php if(!empty($font_size)): ?>
|
5870 |
+
font-size: <?php echo $font_size; ?>;
|
5871 |
+
<?php endif; ?>
|
5872 |
+
<?php if(!empty($font_family)): ?>
|
5873 |
+
font-family: <?php echo $font_family; ?>;
|
5874 |
+
<?php endif; ?>
|
5875 |
+
<?php if(!empty($margin)): ?>
|
5876 |
+
margin: <?php echo $margin; ?>;
|
5877 |
+
<?php endif; ?>
|
5878 |
+
<?php if(!empty($text_align)): ?>
|
5879 |
+
text-align: <?php echo $text_align; ?>;
|
5880 |
+
<?php endif; ?>
|
5881 |
+
<?php if(!empty($css)): ?>
|
5882 |
+
<?php echo $css; ?>
|
5883 |
+
<?php endif; ?>
|
5884 |
+
}
|
5885 |
+
<?php if(!empty($css_hover)): ?>
|
5886 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
5887 |
+
<?php echo $css_hover; ?>
|
5888 |
+
}
|
5889 |
+
<?php endif; ?>
|
5890 |
+
</style>
|
5891 |
+
<?php
|
5892 |
+
}
|
5893 |
+
|
5894 |
+
|
5895 |
+
|
5896 |
+
|
5897 |
+
add_action('post_grid_layout_element_option_wck_colorpicker','post_grid_layout_element_option_wck_colorpicker');
|
5898 |
+
function post_grid_layout_element_option_wck_colorpicker($parameters){
|
5899 |
+
|
5900 |
+
$settings_tabs_field = new settings_tabs_field();
|
5901 |
+
|
5902 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
5903 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
5904 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
5905 |
+
|
5906 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
5907 |
+
|
5908 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
5909 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
5910 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
5911 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
5912 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
5913 |
+
|
5914 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
5915 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
5916 |
+
|
5917 |
+
|
5918 |
+
|
5919 |
+
?>
|
5920 |
+
<div class="item">
|
5921 |
+
<div class="element-title header ">
|
5922 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
5923 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
5924 |
+
|
5925 |
+
<span class="expand"><?php echo __('WCK Color picker','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
5926 |
+
</div>
|
5927 |
+
<div class="element-options options">
|
5928 |
+
|
5929 |
+
<?php
|
5930 |
+
|
5931 |
+
$args = array(
|
5932 |
+
'id' => 'wck_key',
|
5933 |
+
'css_id' => $element_index.'_text',
|
5934 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
5935 |
+
'title' => __('WCK key','post-grid'),
|
5936 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
5937 |
+
'type' => 'text',
|
5938 |
+
'value' => $wck_key,
|
5939 |
+
'default' => '',
|
5940 |
+
'placeholder' => '',
|
5941 |
+
);
|
5942 |
+
|
5943 |
+
$settings_tabs_field->generate_field($args);
|
5944 |
+
|
5945 |
+
$args = array(
|
5946 |
+
'id' => 'color',
|
5947 |
+
'css_id' => $element_index.'_wck_colorpicker',
|
5948 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
5949 |
+
'title' => __('Color','post-grid'),
|
5950 |
+
'details' => __('Title text color.','post-grid'),
|
5951 |
+
'type' => 'colorpicker',
|
5952 |
+
'value' => $color,
|
5953 |
+
'default' => '',
|
5954 |
+
);
|
5955 |
+
|
5956 |
+
$settings_tabs_field->generate_field($args);
|
5957 |
+
|
5958 |
+
$args = array(
|
5959 |
+
'id' => 'font_size',
|
5960 |
+
'css_id' => $element_index.'_font_size',
|
5961 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
5962 |
+
'title' => __('Font size','post-grid'),
|
5963 |
+
'details' => __('Set font size.','post-grid'),
|
5964 |
+
'type' => 'text',
|
5965 |
+
'value' => $font_size,
|
5966 |
+
'default' => '',
|
5967 |
+
'placeholder' => '14px',
|
5968 |
+
);
|
5969 |
+
|
5970 |
+
$settings_tabs_field->generate_field($args);
|
5971 |
+
|
5972 |
+
|
5973 |
+
$args = array(
|
5974 |
+
'id' => 'font_family',
|
5975 |
+
'css_id' => $element_index.'_font_family',
|
5976 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
5977 |
+
'title' => __('Font family','post-grid'),
|
5978 |
+
'details' => __('Set font family.','post-grid'),
|
5979 |
+
'type' => 'text',
|
5980 |
+
'value' => $font_family,
|
5981 |
+
'default' => '',
|
5982 |
+
'placeholder' => 'Open Sans',
|
5983 |
+
);
|
5984 |
+
|
5985 |
+
$settings_tabs_field->generate_field($args);
|
5986 |
+
|
5987 |
+
|
5988 |
+
$args = array(
|
5989 |
+
'id' => 'margin',
|
5990 |
+
'css_id' => $element_index.'_margin',
|
5991 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
5992 |
+
'title' => __('Margin','post-grid'),
|
5993 |
+
'details' => __('Set margin.','post-grid'),
|
5994 |
+
'type' => 'text',
|
5995 |
+
'value' => $margin,
|
5996 |
+
'default' => '',
|
5997 |
+
'placeholder' => '5px 0',
|
5998 |
+
);
|
5999 |
+
|
6000 |
+
$settings_tabs_field->generate_field($args);
|
6001 |
+
|
6002 |
+
|
6003 |
+
$args = array(
|
6004 |
+
'id' => 'text_align',
|
6005 |
+
'css_id' => $element_index.'_text_align',
|
6006 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
6007 |
+
'title' => __('Text align','post-grid'),
|
6008 |
+
'details' => __('Choose text align.','post-grid'),
|
6009 |
+
'type' => 'select',
|
6010 |
+
'value' => $text_align,
|
6011 |
+
'default' => 'left',
|
6012 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
6013 |
+
);
|
6014 |
+
|
6015 |
+
$settings_tabs_field->generate_field($args);
|
6016 |
+
|
6017 |
+
|
6018 |
+
$args = array(
|
6019 |
+
'id' => 'css',
|
6020 |
+
'css_id' => $element_index.'_css',
|
6021 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
6022 |
+
'title' => __('Custom CSS','post-grid'),
|
6023 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
6024 |
+
'type' => 'textarea',
|
6025 |
+
'value' => $css,
|
6026 |
+
'default' => '',
|
6027 |
+
'placeholder' => '',
|
6028 |
+
);
|
6029 |
+
|
6030 |
+
$settings_tabs_field->generate_field($args);
|
6031 |
+
|
6032 |
+
$args = array(
|
6033 |
+
'id' => 'css_hover',
|
6034 |
+
'css_id' => $element_index.'_css_hover',
|
6035 |
+
'parent' => $input_name.'[wck_colorpicker]',
|
6036 |
+
'title' => __('Hover CSS','post-grid'),
|
6037 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
6038 |
+
'type' => 'textarea',
|
6039 |
+
'value' => $css_hover,
|
6040 |
+
'default' => '',
|
6041 |
+
'placeholder' => '',
|
6042 |
+
);
|
6043 |
+
|
6044 |
+
$settings_tabs_field->generate_field($args);
|
6045 |
+
|
6046 |
+
|
6047 |
+
ob_start();
|
6048 |
+
?>
|
6049 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
6050 |
+
<?php
|
6051 |
+
|
6052 |
+
$html = ob_get_clean();
|
6053 |
+
|
6054 |
+
$args = array(
|
6055 |
+
'id' => 'use_css',
|
6056 |
+
'title' => __('Use of CSS','post-grid'),
|
6057 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
6058 |
+
'type' => 'custom_html',
|
6059 |
+
'html' => $html,
|
6060 |
+
|
6061 |
+
);
|
6062 |
+
|
6063 |
+
$settings_tabs_field->generate_field($args);
|
6064 |
+
|
6065 |
+
?>
|
6066 |
+
|
6067 |
+
</div>
|
6068 |
+
</div>
|
6069 |
+
<?php
|
6070 |
+
|
6071 |
+
}
|
6072 |
+
|
6073 |
+
|
6074 |
+
|
6075 |
+
add_action('post_grid_layout_element_wck_colorpicker', 'post_grid_layout_element_wck_colorpicker');
|
6076 |
+
function post_grid_layout_element_wck_colorpicker($args){
|
6077 |
+
|
6078 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6079 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
6080 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
6081 |
+
|
6082 |
+
if(empty($post_id)) return;
|
6083 |
+
|
6084 |
+
$title = get_the_title($post_id);
|
6085 |
+
|
6086 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
6087 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
6088 |
+
|
6089 |
+
|
6090 |
+
|
6091 |
+
//var_dump($wck_key);
|
6092 |
+
|
6093 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
6094 |
+
|
6095 |
+
if(!empty($wck_value)):
|
6096 |
+
|
6097 |
+
?>
|
6098 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_colorpicker ">
|
6099 |
+
<?php echo esc_html($wck_value); ?>
|
6100 |
+
</div>
|
6101 |
+
<?php
|
6102 |
+
endif;
|
6103 |
+
|
6104 |
+
}
|
6105 |
+
|
6106 |
+
|
6107 |
+
|
6108 |
+
add_action('post_grid_layout_element_css_wck_colorpicker', 'post_grid_layout_element_css_wck_colorpicker', 10);
|
6109 |
+
function post_grid_layout_element_css_wck_colorpicker($args){
|
6110 |
+
|
6111 |
+
|
6112 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
6113 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6114 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
6115 |
+
|
6116 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
6117 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
6118 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
6119 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
6120 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
6121 |
+
|
6122 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
6123 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
6124 |
+
|
6125 |
+
?>
|
6126 |
+
<style type="text/css">
|
6127 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
6128 |
+
<?php if(!empty($color)): ?>
|
6129 |
+
color: <?php echo $color; ?>;
|
6130 |
+
<?php endif; ?>
|
6131 |
+
<?php if(!empty($font_size)): ?>
|
6132 |
+
font-size: <?php echo $font_size; ?>;
|
6133 |
+
<?php endif; ?>
|
6134 |
+
<?php if(!empty($font_family)): ?>
|
6135 |
+
font-family: <?php echo $font_family; ?>;
|
6136 |
+
<?php endif; ?>
|
6137 |
+
<?php if(!empty($margin)): ?>
|
6138 |
+
margin: <?php echo $margin; ?>;
|
6139 |
+
<?php endif; ?>
|
6140 |
+
<?php if(!empty($text_align)): ?>
|
6141 |
+
text-align: <?php echo $text_align; ?>;
|
6142 |
+
<?php endif; ?>
|
6143 |
+
<?php if(!empty($css)): ?>
|
6144 |
+
<?php echo $css; ?>
|
6145 |
+
<?php endif; ?>
|
6146 |
+
}
|
6147 |
+
<?php if(!empty($css_hover)): ?>
|
6148 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
6149 |
+
<?php echo $css_hover; ?>
|
6150 |
+
}
|
6151 |
+
<?php endif; ?>
|
6152 |
+
</style>
|
6153 |
+
<?php
|
6154 |
+
}
|
6155 |
+
|
6156 |
+
|
6157 |
+
|
6158 |
+
add_action('post_grid_layout_element_option_wck_link','post_grid_layout_element_option_wck_link');
|
6159 |
+
function post_grid_layout_element_option_wck_link($parameters){
|
6160 |
+
|
6161 |
+
$settings_tabs_field = new settings_tabs_field();
|
6162 |
+
|
6163 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
6164 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
6165 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
6166 |
+
|
6167 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
6168 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
6169 |
+
|
6170 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
6171 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
6172 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
6173 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
6174 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
6175 |
+
|
6176 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
6177 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
6178 |
+
|
6179 |
+
|
6180 |
+
|
6181 |
+
?>
|
6182 |
+
<div class="item">
|
6183 |
+
<div class="element-title header ">
|
6184 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
6185 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
6186 |
+
|
6187 |
+
<span class="expand"><?php echo __('WCK Link','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
6188 |
+
</div>
|
6189 |
+
<div class="element-options options">
|
6190 |
+
|
6191 |
+
<?php
|
6192 |
+
|
6193 |
+
$args = array(
|
6194 |
+
'id' => 'wck_key',
|
6195 |
+
'css_id' => $element_index.'_text',
|
6196 |
+
'parent' => $input_name.'[wck_link]',
|
6197 |
+
'title' => __('WCK key','post-grid'),
|
6198 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
6199 |
+
'type' => 'text',
|
6200 |
+
'value' => $wck_key,
|
6201 |
+
'default' => '',
|
6202 |
+
'placeholder' => '',
|
6203 |
+
);
|
6204 |
+
|
6205 |
+
$settings_tabs_field->generate_field($args);
|
6206 |
+
|
6207 |
+
$args = array(
|
6208 |
+
'id' => 'wrapper_html',
|
6209 |
+
'css_id' => $element_index.'_wrapper_html',
|
6210 |
+
'parent' => $input_name.'[wck_link]',
|
6211 |
+
'title' => __('Wrapper html','post-grid'),
|
6212 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Link: %s</code> or <code>Link: <a href="%s">Visit link</a> </code>','post-grid'),
|
6213 |
+
'type' => 'text',
|
6214 |
+
'value' => $wrapper_html,
|
6215 |
+
'default' => '',
|
6216 |
+
'placeholder' => 'Link: %s',
|
6217 |
+
);
|
6218 |
+
|
6219 |
+
$settings_tabs_field->generate_field($args);
|
6220 |
+
|
6221 |
+
|
6222 |
+
$args = array(
|
6223 |
+
'id' => 'color',
|
6224 |
+
'css_id' => $element_index.'_wck_link',
|
6225 |
+
'parent' => $input_name.'[wck_link]',
|
6226 |
+
'title' => __('Color','post-grid'),
|
6227 |
+
'details' => __('Title text color.','post-grid'),
|
6228 |
+
'type' => 'colorpicker',
|
6229 |
+
'value' => $color,
|
6230 |
+
'default' => '',
|
6231 |
+
);
|
6232 |
+
|
6233 |
+
$settings_tabs_field->generate_field($args);
|
6234 |
+
|
6235 |
+
$args = array(
|
6236 |
+
'id' => 'font_size',
|
6237 |
+
'css_id' => $element_index.'_font_size',
|
6238 |
+
'parent' => $input_name.'[wck_link]',
|
6239 |
+
'title' => __('Font size','post-grid'),
|
6240 |
+
'details' => __('Set font size.','post-grid'),
|
6241 |
+
'type' => 'text',
|
6242 |
+
'value' => $font_size,
|
6243 |
+
'default' => '',
|
6244 |
+
'placeholder' => '14px',
|
6245 |
+
);
|
6246 |
+
|
6247 |
+
$settings_tabs_field->generate_field($args);
|
6248 |
+
|
6249 |
+
|
6250 |
+
$args = array(
|
6251 |
+
'id' => 'font_family',
|
6252 |
+
'css_id' => $element_index.'_font_family',
|
6253 |
+
'parent' => $input_name.'[wck_link]',
|
6254 |
+
'title' => __('Font family','post-grid'),
|
6255 |
+
'details' => __('Set font family.','post-grid'),
|
6256 |
+
'type' => 'text',
|
6257 |
+
'value' => $font_family,
|
6258 |
+
'default' => '',
|
6259 |
+
'placeholder' => 'Open Sans',
|
6260 |
+
);
|
6261 |
+
|
6262 |
+
$settings_tabs_field->generate_field($args);
|
6263 |
+
|
6264 |
+
|
6265 |
+
$args = array(
|
6266 |
+
'id' => 'margin',
|
6267 |
+
'css_id' => $element_index.'_margin',
|
6268 |
+
'parent' => $input_name.'[wck_link]',
|
6269 |
+
'title' => __('Margin','post-grid'),
|
6270 |
+
'details' => __('Set margin.','post-grid'),
|
6271 |
+
'type' => 'text',
|
6272 |
+
'value' => $margin,
|
6273 |
+
'default' => '',
|
6274 |
+
'placeholder' => '5px 0',
|
6275 |
+
);
|
6276 |
+
|
6277 |
+
$settings_tabs_field->generate_field($args);
|
6278 |
+
|
6279 |
+
|
6280 |
+
$args = array(
|
6281 |
+
'id' => 'text_align',
|
6282 |
+
'css_id' => $element_index.'_text_align',
|
6283 |
+
'parent' => $input_name.'[wck_link]',
|
6284 |
+
'title' => __('Text align','post-grid'),
|
6285 |
+
'details' => __('Choose text align.','post-grid'),
|
6286 |
+
'type' => 'select',
|
6287 |
+
'value' => $text_align,
|
6288 |
+
'default' => 'left',
|
6289 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
6290 |
+
);
|
6291 |
+
|
6292 |
+
$settings_tabs_field->generate_field($args);
|
6293 |
+
|
6294 |
+
|
6295 |
+
$args = array(
|
6296 |
+
'id' => 'css',
|
6297 |
+
'css_id' => $element_index.'_css',
|
6298 |
+
'parent' => $input_name.'[wck_link]',
|
6299 |
+
'title' => __('Custom CSS','post-grid'),
|
6300 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
6301 |
+
'type' => 'textarea',
|
6302 |
+
'value' => $css,
|
6303 |
+
'default' => '',
|
6304 |
+
'placeholder' => '',
|
6305 |
+
);
|
6306 |
+
|
6307 |
+
$settings_tabs_field->generate_field($args);
|
6308 |
+
|
6309 |
+
$args = array(
|
6310 |
+
'id' => 'css_hover',
|
6311 |
+
'css_id' => $element_index.'_css_hover',
|
6312 |
+
'parent' => $input_name.'[wck_link]',
|
6313 |
+
'title' => __('Hover CSS','post-grid'),
|
6314 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
6315 |
+
'type' => 'textarea',
|
6316 |
+
'value' => $css_hover,
|
6317 |
+
'default' => '',
|
6318 |
+
'placeholder' => '',
|
6319 |
+
);
|
6320 |
+
|
6321 |
+
$settings_tabs_field->generate_field($args);
|
6322 |
+
|
6323 |
+
|
6324 |
+
ob_start();
|
6325 |
+
?>
|
6326 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
6327 |
+
<?php
|
6328 |
+
|
6329 |
+
$html = ob_get_clean();
|
6330 |
+
|
6331 |
+
$args = array(
|
6332 |
+
'id' => 'use_css',
|
6333 |
+
'title' => __('Use of CSS','post-grid'),
|
6334 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
6335 |
+
'type' => 'custom_html',
|
6336 |
+
'html' => $html,
|
6337 |
+
|
6338 |
+
);
|
6339 |
+
|
6340 |
+
$settings_tabs_field->generate_field($args);
|
6341 |
+
|
6342 |
+
?>
|
6343 |
+
|
6344 |
+
</div>
|
6345 |
+
</div>
|
6346 |
+
<?php
|
6347 |
+
|
6348 |
+
}
|
6349 |
+
|
6350 |
+
|
6351 |
+
|
6352 |
+
add_action('post_grid_layout_element_wck_link', 'post_grid_layout_element_wck_link');
|
6353 |
+
function post_grid_layout_element_wck_link($args){
|
6354 |
+
|
6355 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6356 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
6357 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
6358 |
+
|
6359 |
+
if(empty($post_id)) return;
|
6360 |
+
|
6361 |
+
$title = get_the_title($post_id);
|
6362 |
+
|
6363 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
6364 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
6365 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
6366 |
+
|
6367 |
+
|
6368 |
+
|
6369 |
+
//var_dump($wrapper_html);
|
6370 |
+
|
6371 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
6372 |
+
|
6373 |
+
//var_dump($wck_value);
|
6374 |
+
|
6375 |
+
if(!empty($wck_value)):
|
6376 |
+
|
6377 |
+
if(is_array($wck_value)):
|
6378 |
+
$title = isset($wck_value['title']) ?$wck_value['title'] : '';
|
6379 |
+
$url = isset($wck_value['url']) ?$wck_value['url'] : '';
|
6380 |
+
$target = isset($wck_value['target']) ?$wck_value['target'] : '';
|
6381 |
+
|
6382 |
+
$wck_value = "<a target='$target' href='$url'>$title</a>";
|
6383 |
+
|
6384 |
+
endif;
|
6385 |
+
|
6386 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
6387 |
+
|
6388 |
+
?>
|
6389 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_link ">
|
6390 |
+
<?php echo ($wck_value); ?>
|
6391 |
+
</div>
|
6392 |
+
<?php
|
6393 |
+
endif;
|
6394 |
+
|
6395 |
+
}
|
6396 |
+
|
6397 |
+
|
6398 |
+
|
6399 |
+
add_action('post_grid_layout_element_css_wck_link', 'post_grid_layout_element_css_wck_link', 10);
|
6400 |
+
function post_grid_layout_element_css_wck_link($args){
|
6401 |
+
|
6402 |
+
|
6403 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
6404 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6405 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
6406 |
+
|
6407 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
6408 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
6409 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
6410 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
6411 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
6412 |
+
|
6413 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
6414 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
6415 |
+
|
6416 |
+
?>
|
6417 |
+
<style type="text/css">
|
6418 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
6419 |
+
<?php if(!empty($color)): ?>
|
6420 |
+
color: <?php echo $color; ?>;
|
6421 |
+
<?php endif; ?>
|
6422 |
+
<?php if(!empty($font_size)): ?>
|
6423 |
+
font-size: <?php echo $font_size; ?>;
|
6424 |
+
<?php endif; ?>
|
6425 |
+
<?php if(!empty($font_family)): ?>
|
6426 |
+
font-family: <?php echo $font_family; ?>;
|
6427 |
+
<?php endif; ?>
|
6428 |
+
<?php if(!empty($margin)): ?>
|
6429 |
+
margin: <?php echo $margin; ?>;
|
6430 |
+
<?php endif; ?>
|
6431 |
+
<?php if(!empty($text_align)): ?>
|
6432 |
+
text-align: <?php echo $text_align; ?>;
|
6433 |
+
<?php endif; ?>
|
6434 |
+
<?php if(!empty($css)): ?>
|
6435 |
+
<?php echo $css; ?>
|
6436 |
+
<?php endif; ?>
|
6437 |
+
}
|
6438 |
+
<?php if(!empty($css_hover)): ?>
|
6439 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
6440 |
+
<?php echo $css_hover; ?>
|
6441 |
+
}
|
6442 |
+
<?php endif; ?>
|
6443 |
+
</style>
|
6444 |
+
<?php
|
6445 |
+
}
|
6446 |
+
|
6447 |
+
|
6448 |
+
add_action('post_grid_layout_element_option_wck_post_object','post_grid_layout_element_option_wck_post_object');
|
6449 |
+
function post_grid_layout_element_option_wck_post_object($parameters){
|
6450 |
+
|
6451 |
+
$settings_tabs_field = new settings_tabs_field();
|
6452 |
+
|
6453 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
6454 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
6455 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
6456 |
+
|
6457 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
6458 |
+
|
6459 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
6460 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
6461 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
6462 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
6463 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
6464 |
+
|
6465 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
6466 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
6467 |
+
|
6468 |
+
|
6469 |
+
|
6470 |
+
?>
|
6471 |
+
<div class="item">
|
6472 |
+
<div class="element-title header ">
|
6473 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
6474 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
6475 |
+
|
6476 |
+
<span class="expand"><?php echo __('WCK Text','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
6477 |
+
</div>
|
6478 |
+
<div class="element-options options">
|
6479 |
+
|
6480 |
+
<?php
|
6481 |
+
|
6482 |
+
$args = array(
|
6483 |
+
'id' => 'wck_key',
|
6484 |
+
'css_id' => $element_index.'_text',
|
6485 |
+
'parent' => $input_name.'[wck_post_object]',
|
6486 |
+
'title' => __('WCK key','post-grid'),
|
6487 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
6488 |
+
'type' => 'text',
|
6489 |
+
'value' => $wck_key,
|
6490 |
+
'default' => '',
|
6491 |
+
'placeholder' => '',
|
6492 |
+
);
|
6493 |
+
|
6494 |
+
$settings_tabs_field->generate_field($args);
|
6495 |
+
|
6496 |
+
$args = array(
|
6497 |
+
'id' => 'color',
|
6498 |
+
'css_id' => $element_index.'_wck_post_object',
|
6499 |
+
'parent' => $input_name.'[wck_post_object]',
|
6500 |
+
'title' => __('Color','post-grid'),
|
6501 |
+
'details' => __('Title text color.','post-grid'),
|
6502 |
+
'type' => 'colorpicker',
|
6503 |
+
'value' => $color,
|
6504 |
+
'default' => '',
|
6505 |
+
);
|
6506 |
+
|
6507 |
+
$settings_tabs_field->generate_field($args);
|
6508 |
+
|
6509 |
+
$args = array(
|
6510 |
+
'id' => 'font_size',
|
6511 |
+
'css_id' => $element_index.'_font_size',
|
6512 |
+
'parent' => $input_name.'[wck_post_object]',
|
6513 |
+
'title' => __('Font size','post-grid'),
|
6514 |
+
'details' => __('Set font size.','post-grid'),
|
6515 |
+
'type' => 'text',
|
6516 |
+
'value' => $font_size,
|
6517 |
+
'default' => '',
|
6518 |
+
'placeholder' => '14px',
|
6519 |
+
);
|
6520 |
+
|
6521 |
+
$settings_tabs_field->generate_field($args);
|
6522 |
+
|
6523 |
+
|
6524 |
+
$args = array(
|
6525 |
+
'id' => 'font_family',
|
6526 |
+
'css_id' => $element_index.'_font_family',
|
6527 |
+
'parent' => $input_name.'[wck_post_object]',
|
6528 |
+
'title' => __('Font family','post-grid'),
|
6529 |
+
'details' => __('Set font family.','post-grid'),
|
6530 |
+
'type' => 'text',
|
6531 |
+
'value' => $font_family,
|
6532 |
+
'default' => '',
|
6533 |
+
'placeholder' => 'Open Sans',
|
6534 |
+
);
|
6535 |
+
|
6536 |
+
$settings_tabs_field->generate_field($args);
|
6537 |
+
|
6538 |
+
|
6539 |
+
$args = array(
|
6540 |
+
'id' => 'margin',
|
6541 |
+
'css_id' => $element_index.'_margin',
|
6542 |
+
'parent' => $input_name.'[wck_post_object]',
|
6543 |
+
'title' => __('Margin','post-grid'),
|
6544 |
+
'details' => __('Set margin.','post-grid'),
|
6545 |
+
'type' => 'text',
|
6546 |
+
'value' => $margin,
|
6547 |
+
'default' => '',
|
6548 |
+
'placeholder' => '5px 0',
|
6549 |
+
);
|
6550 |
+
|
6551 |
+
$settings_tabs_field->generate_field($args);
|
6552 |
+
|
6553 |
+
|
6554 |
+
$args = array(
|
6555 |
+
'id' => 'text_align',
|
6556 |
+
'css_id' => $element_index.'_text_align',
|
6557 |
+
'parent' => $input_name.'[wck_post_object]',
|
6558 |
+
'title' => __('Text align','post-grid'),
|
6559 |
+
'details' => __('Choose text align.','post-grid'),
|
6560 |
+
'type' => 'select',
|
6561 |
+
'value' => $text_align,
|
6562 |
+
'default' => 'left',
|
6563 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
6564 |
+
);
|
6565 |
+
|
6566 |
+
$settings_tabs_field->generate_field($args);
|
6567 |
+
|
6568 |
+
|
6569 |
+
$args = array(
|
6570 |
+
'id' => 'css',
|
6571 |
+
'css_id' => $element_index.'_css',
|
6572 |
+
'parent' => $input_name.'[wck_post_object]',
|
6573 |
+
'title' => __('Custom CSS','post-grid'),
|
6574 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
6575 |
+
'type' => 'textarea',
|
6576 |
+
'value' => $css,
|
6577 |
+
'default' => '',
|
6578 |
+
'placeholder' => '',
|
6579 |
+
);
|
6580 |
+
|
6581 |
+
$settings_tabs_field->generate_field($args);
|
6582 |
+
|
6583 |
+
$args = array(
|
6584 |
+
'id' => 'css_hover',
|
6585 |
+
'css_id' => $element_index.'_css_hover',
|
6586 |
+
'parent' => $input_name.'[wck_post_object]',
|
6587 |
+
'title' => __('Hover CSS','post-grid'),
|
6588 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
6589 |
+
'type' => 'textarea',
|
6590 |
+
'value' => $css_hover,
|
6591 |
+
'default' => '',
|
6592 |
+
'placeholder' => '',
|
6593 |
+
);
|
6594 |
+
|
6595 |
+
$settings_tabs_field->generate_field($args);
|
6596 |
+
|
6597 |
+
|
6598 |
+
ob_start();
|
6599 |
+
?>
|
6600 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
6601 |
+
<?php
|
6602 |
+
|
6603 |
+
$html = ob_get_clean();
|
6604 |
+
|
6605 |
+
$args = array(
|
6606 |
+
'id' => 'use_css',
|
6607 |
+
'title' => __('Use of CSS','post-grid'),
|
6608 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
6609 |
+
'type' => 'custom_html',
|
6610 |
+
'html' => $html,
|
6611 |
+
|
6612 |
+
);
|
6613 |
+
|
6614 |
+
$settings_tabs_field->generate_field($args);
|
6615 |
+
|
6616 |
+
?>
|
6617 |
+
|
6618 |
+
</div>
|
6619 |
+
</div>
|
6620 |
+
<?php
|
6621 |
+
|
6622 |
+
}
|
6623 |
+
|
6624 |
+
|
6625 |
+
|
6626 |
+
add_action('post_grid_layout_element_wck_post_object', 'post_grid_layout_element_wck_post_object');
|
6627 |
+
function post_grid_layout_element_wck_post_object($args){
|
6628 |
+
|
6629 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6630 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
6631 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
6632 |
+
|
6633 |
+
if(empty($post_id)) return;
|
6634 |
+
|
6635 |
+
$title = get_the_title($post_id);
|
6636 |
+
|
6637 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
6638 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
6639 |
+
|
6640 |
+
|
6641 |
+
|
6642 |
+
//var_dump($wck_key);
|
6643 |
+
|
6644 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
6645 |
+
|
6646 |
+
if(!empty($wck_value)):
|
6647 |
+
|
6648 |
+
?>
|
6649 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_post_object ">
|
6650 |
+
<?php echo esc_html($wck_value); ?>
|
6651 |
+
</div>
|
6652 |
+
<?php
|
6653 |
+
endif;
|
6654 |
+
|
6655 |
+
}
|
6656 |
+
|
6657 |
+
|
6658 |
+
|
6659 |
+
add_action('post_grid_layout_element_css_wck_post_object', 'post_grid_layout_element_css_wck_post_object', 10);
|
6660 |
+
function post_grid_layout_element_css_wck_post_object($args){
|
6661 |
+
|
6662 |
+
|
6663 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
6664 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6665 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
6666 |
+
|
6667 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
6668 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
6669 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
6670 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
6671 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
6672 |
+
|
6673 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
6674 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
6675 |
+
|
6676 |
+
?>
|
6677 |
+
<style type="text/css">
|
6678 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
6679 |
+
<?php if(!empty($color)): ?>
|
6680 |
+
color: <?php echo $color; ?>;
|
6681 |
+
<?php endif; ?>
|
6682 |
+
<?php if(!empty($font_size)): ?>
|
6683 |
+
font-size: <?php echo $font_size; ?>;
|
6684 |
+
<?php endif; ?>
|
6685 |
+
<?php if(!empty($font_family)): ?>
|
6686 |
+
font-family: <?php echo $font_family; ?>;
|
6687 |
+
<?php endif; ?>
|
6688 |
+
<?php if(!empty($margin)): ?>
|
6689 |
+
margin: <?php echo $margin; ?>;
|
6690 |
+
<?php endif; ?>
|
6691 |
+
<?php if(!empty($text_align)): ?>
|
6692 |
+
text-align: <?php echo $text_align; ?>;
|
6693 |
+
<?php endif; ?>
|
6694 |
+
<?php if(!empty($css)): ?>
|
6695 |
+
<?php echo $css; ?>
|
6696 |
+
<?php endif; ?>
|
6697 |
+
}
|
6698 |
+
<?php if(!empty($css_hover)): ?>
|
6699 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
6700 |
+
<?php echo $css_hover; ?>
|
6701 |
+
}
|
6702 |
+
<?php endif; ?>
|
6703 |
+
</style>
|
6704 |
+
<?php
|
6705 |
+
}
|
6706 |
+
|
6707 |
+
|
6708 |
+
add_action('post_grid_layout_element_option_wck_oembed','post_grid_layout_element_option_wck_oembed');
|
6709 |
+
function post_grid_layout_element_option_wck_oembed($parameters){
|
6710 |
+
|
6711 |
+
$settings_tabs_field = new settings_tabs_field();
|
6712 |
+
|
6713 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
6714 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
6715 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
6716 |
+
|
6717 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
6718 |
+
|
6719 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
6720 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
6721 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
6722 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
6723 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
6724 |
+
|
6725 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
6726 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
6727 |
+
|
6728 |
+
|
6729 |
+
|
6730 |
+
?>
|
6731 |
+
<div class="item">
|
6732 |
+
<div class="element-title header ">
|
6733 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
6734 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
6735 |
+
|
6736 |
+
<span class="expand"><?php echo __('WCK Text','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
6737 |
+
</div>
|
6738 |
+
<div class="element-options options">
|
6739 |
+
|
6740 |
+
<?php
|
6741 |
+
|
6742 |
+
$args = array(
|
6743 |
+
'id' => 'wck_key',
|
6744 |
+
'css_id' => $element_index.'_text',
|
6745 |
+
'parent' => $input_name.'[wck_oembed]',
|
6746 |
+
'title' => __('WCK key','post-grid'),
|
6747 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
6748 |
+
'type' => 'text',
|
6749 |
+
'value' => $wck_key,
|
6750 |
+
'default' => '',
|
6751 |
+
'placeholder' => '',
|
6752 |
+
);
|
6753 |
+
|
6754 |
+
$settings_tabs_field->generate_field($args);
|
6755 |
+
|
6756 |
+
$args = array(
|
6757 |
+
'id' => 'color',
|
6758 |
+
'css_id' => $element_index.'_wck_oembed',
|
6759 |
+
'parent' => $input_name.'[wck_oembed]',
|
6760 |
+
'title' => __('Color','post-grid'),
|
6761 |
+
'details' => __('Title text color.','post-grid'),
|
6762 |
+
'type' => 'colorpicker',
|
6763 |
+
'value' => $color,
|
6764 |
+
'default' => '',
|
6765 |
+
);
|
6766 |
+
|
6767 |
+
$settings_tabs_field->generate_field($args);
|
6768 |
+
|
6769 |
+
$args = array(
|
6770 |
+
'id' => 'font_size',
|
6771 |
+
'css_id' => $element_index.'_font_size',
|
6772 |
+
'parent' => $input_name.'[wck_oembed]',
|
6773 |
+
'title' => __('Font size','post-grid'),
|
6774 |
+
'details' => __('Set font size.','post-grid'),
|
6775 |
+
'type' => 'text',
|
6776 |
+
'value' => $font_size,
|
6777 |
+
'default' => '',
|
6778 |
+
'placeholder' => '14px',
|
6779 |
+
);
|
6780 |
+
|
6781 |
+
$settings_tabs_field->generate_field($args);
|
6782 |
+
|
6783 |
+
|
6784 |
+
$args = array(
|
6785 |
+
'id' => 'font_family',
|
6786 |
+
'css_id' => $element_index.'_font_family',
|
6787 |
+
'parent' => $input_name.'[wck_oembed]',
|
6788 |
+
'title' => __('Font family','post-grid'),
|
6789 |
+
'details' => __('Set font family.','post-grid'),
|
6790 |
+
'type' => 'text',
|
6791 |
+
'value' => $font_family,
|
6792 |
+
'default' => '',
|
6793 |
+
'placeholder' => 'Open Sans',
|
6794 |
+
);
|
6795 |
+
|
6796 |
+
$settings_tabs_field->generate_field($args);
|
6797 |
+
|
6798 |
+
|
6799 |
+
$args = array(
|
6800 |
+
'id' => 'margin',
|
6801 |
+
'css_id' => $element_index.'_margin',
|
6802 |
+
'parent' => $input_name.'[wck_oembed]',
|
6803 |
+
'title' => __('Margin','post-grid'),
|
6804 |
+
'details' => __('Set margin.','post-grid'),
|
6805 |
+
'type' => 'text',
|
6806 |
+
'value' => $margin,
|
6807 |
+
'default' => '',
|
6808 |
+
'placeholder' => '5px 0',
|
6809 |
+
);
|
6810 |
+
|
6811 |
+
$settings_tabs_field->generate_field($args);
|
6812 |
+
|
6813 |
+
|
6814 |
+
$args = array(
|
6815 |
+
'id' => 'text_align',
|
6816 |
+
'css_id' => $element_index.'_text_align',
|
6817 |
+
'parent' => $input_name.'[wck_oembed]',
|
6818 |
+
'title' => __('Text align','post-grid'),
|
6819 |
+
'details' => __('Choose text align.','post-grid'),
|
6820 |
+
'type' => 'select',
|
6821 |
+
'value' => $text_align,
|
6822 |
+
'default' => 'left',
|
6823 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
6824 |
+
);
|
6825 |
+
|
6826 |
+
$settings_tabs_field->generate_field($args);
|
6827 |
+
|
6828 |
+
|
6829 |
+
$args = array(
|
6830 |
+
'id' => 'css',
|
6831 |
+
'css_id' => $element_index.'_css',
|
6832 |
+
'parent' => $input_name.'[wck_oembed]',
|
6833 |
+
'title' => __('Custom CSS','post-grid'),
|
6834 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
6835 |
+
'type' => 'textarea',
|
6836 |
+
'value' => $css,
|
6837 |
+
'default' => '',
|
6838 |
+
'placeholder' => '',
|
6839 |
+
);
|
6840 |
+
|
6841 |
+
$settings_tabs_field->generate_field($args);
|
6842 |
+
|
6843 |
+
$args = array(
|
6844 |
+
'id' => 'css_hover',
|
6845 |
+
'css_id' => $element_index.'_css_hover',
|
6846 |
+
'parent' => $input_name.'[wck_oembed]',
|
6847 |
+
'title' => __('Hover CSS','post-grid'),
|
6848 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
6849 |
+
'type' => 'textarea',
|
6850 |
+
'value' => $css_hover,
|
6851 |
+
'default' => '',
|
6852 |
+
'placeholder' => '',
|
6853 |
+
);
|
6854 |
+
|
6855 |
+
$settings_tabs_field->generate_field($args);
|
6856 |
+
|
6857 |
+
|
6858 |
+
ob_start();
|
6859 |
+
?>
|
6860 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
6861 |
+
<?php
|
6862 |
+
|
6863 |
+
$html = ob_get_clean();
|
6864 |
+
|
6865 |
+
$args = array(
|
6866 |
+
'id' => 'use_css',
|
6867 |
+
'title' => __('Use of CSS','post-grid'),
|
6868 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
6869 |
+
'type' => 'custom_html',
|
6870 |
+
'html' => $html,
|
6871 |
+
|
6872 |
+
);
|
6873 |
+
|
6874 |
+
$settings_tabs_field->generate_field($args);
|
6875 |
+
|
6876 |
+
?>
|
6877 |
+
|
6878 |
+
</div>
|
6879 |
+
</div>
|
6880 |
+
<?php
|
6881 |
+
|
6882 |
+
}
|
6883 |
+
|
6884 |
+
|
6885 |
+
|
6886 |
+
add_action('post_grid_layout_element_wck_oembed', 'post_grid_layout_element_wck_oembed');
|
6887 |
+
function post_grid_layout_element_wck_oembed($args){
|
6888 |
+
|
6889 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6890 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
6891 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
6892 |
+
|
6893 |
+
if(empty($post_id)) return;
|
6894 |
+
|
6895 |
+
$title = get_the_title($post_id);
|
6896 |
+
|
6897 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
6898 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
6899 |
+
|
6900 |
+
|
6901 |
+
|
6902 |
+
//var_dump($wck_key);
|
6903 |
+
|
6904 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
6905 |
+
|
6906 |
+
if(!empty($wck_value)):
|
6907 |
+
|
6908 |
+
?>
|
6909 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_oembed ">
|
6910 |
+
<?php echo ($wck_value); ?>
|
6911 |
+
</div>
|
6912 |
+
<?php
|
6913 |
+
endif;
|
6914 |
+
|
6915 |
+
}
|
6916 |
+
|
6917 |
+
|
6918 |
+
|
6919 |
+
add_action('post_grid_layout_element_css_wck_oembed', 'post_grid_layout_element_css_wck_oembed', 10);
|
6920 |
+
function post_grid_layout_element_css_wck_oembed($args){
|
6921 |
+
|
6922 |
+
|
6923 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
6924 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
6925 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
6926 |
+
|
6927 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
6928 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
6929 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
6930 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
6931 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
6932 |
+
|
6933 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
6934 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
6935 |
+
|
6936 |
+
?>
|
6937 |
+
<style type="text/css">
|
6938 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
6939 |
+
<?php if(!empty($color)): ?>
|
6940 |
+
color: <?php echo $color; ?>;
|
6941 |
+
<?php endif; ?>
|
6942 |
+
<?php if(!empty($font_size)): ?>
|
6943 |
+
font-size: <?php echo $font_size; ?>;
|
6944 |
+
<?php endif; ?>
|
6945 |
+
<?php if(!empty($font_family)): ?>
|
6946 |
+
font-family: <?php echo $font_family; ?>;
|
6947 |
+
<?php endif; ?>
|
6948 |
+
<?php if(!empty($margin)): ?>
|
6949 |
+
margin: <?php echo $margin; ?>;
|
6950 |
+
<?php endif; ?>
|
6951 |
+
<?php if(!empty($text_align)): ?>
|
6952 |
+
text-align: <?php echo $text_align; ?>;
|
6953 |
+
<?php endif; ?>
|
6954 |
+
<?php if(!empty($css)): ?>
|
6955 |
+
<?php echo $css; ?>
|
6956 |
+
<?php endif; ?>
|
6957 |
+
}
|
6958 |
+
<?php if(!empty($css_hover)): ?>
|
6959 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
6960 |
+
<?php echo $css_hover; ?>
|
6961 |
+
}
|
6962 |
+
<?php endif; ?>
|
6963 |
+
</style>
|
6964 |
+
<?php
|
6965 |
+
}
|
6966 |
+
|
6967 |
+
|
6968 |
+
add_action('post_grid_layout_element_option_wck_password','post_grid_layout_element_option_wck_password');
|
6969 |
+
function post_grid_layout_element_option_wck_password($parameters){
|
6970 |
+
|
6971 |
+
$settings_tabs_field = new settings_tabs_field();
|
6972 |
+
|
6973 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
6974 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
6975 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
6976 |
+
|
6977 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
6978 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
6979 |
+
|
6980 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
6981 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
6982 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
6983 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
6984 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
6985 |
+
|
6986 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
6987 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
6988 |
+
|
6989 |
+
|
6990 |
+
|
6991 |
+
?>
|
6992 |
+
<div class="item">
|
6993 |
+
<div class="element-title header ">
|
6994 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
6995 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
6996 |
+
|
6997 |
+
<span class="expand"><?php echo __('WCK Text','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
6998 |
+
</div>
|
6999 |
+
<div class="element-options options">
|
7000 |
+
|
7001 |
+
<?php
|
7002 |
+
|
7003 |
+
$args = array(
|
7004 |
+
'id' => 'wck_key',
|
7005 |
+
'css_id' => $element_index.'_text',
|
7006 |
+
'parent' => $input_name.'[wck_password]',
|
7007 |
+
'title' => __('WCK key','post-grid'),
|
7008 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
7009 |
+
'type' => 'text',
|
7010 |
+
'value' => $wck_key,
|
7011 |
+
'default' => '',
|
7012 |
+
'placeholder' => '',
|
7013 |
+
);
|
7014 |
+
|
7015 |
+
$settings_tabs_field->generate_field($args);
|
7016 |
+
|
7017 |
+
$args = array(
|
7018 |
+
'id' => 'wrapper_html',
|
7019 |
+
'css_id' => $element_index.'_wrapper_html',
|
7020 |
+
'parent' => $input_name.'[wck_password]',
|
7021 |
+
'title' => __('Wrapper html','post-grid'),
|
7022 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Pass: %s</code>','post-grid'),
|
7023 |
+
'type' => 'text',
|
7024 |
+
'value' => $wrapper_html,
|
7025 |
+
'default' => '',
|
7026 |
+
'placeholder' => 'Password: %s',
|
7027 |
+
);
|
7028 |
+
|
7029 |
+
$settings_tabs_field->generate_field($args);
|
7030 |
+
|
7031 |
+
|
7032 |
+
|
7033 |
+
$args = array(
|
7034 |
+
'id' => 'color',
|
7035 |
+
'css_id' => $element_index.'_wck_password',
|
7036 |
+
'parent' => $input_name.'[wck_password]',
|
7037 |
+
'title' => __('Color','post-grid'),
|
7038 |
+
'details' => __('Title text color.','post-grid'),
|
7039 |
+
'type' => 'colorpicker',
|
7040 |
+
'value' => $color,
|
7041 |
+
'default' => '',
|
7042 |
+
);
|
7043 |
+
|
7044 |
+
$settings_tabs_field->generate_field($args);
|
7045 |
+
|
7046 |
+
$args = array(
|
7047 |
+
'id' => 'font_size',
|
7048 |
+
'css_id' => $element_index.'_font_size',
|
7049 |
+
'parent' => $input_name.'[wck_password]',
|
7050 |
+
'title' => __('Font size','post-grid'),
|
7051 |
+
'details' => __('Set font size.','post-grid'),
|
7052 |
+
'type' => 'text',
|
7053 |
+
'value' => $font_size,
|
7054 |
+
'default' => '',
|
7055 |
+
'placeholder' => '14px',
|
7056 |
+
);
|
7057 |
+
|
7058 |
+
$settings_tabs_field->generate_field($args);
|
7059 |
+
|
7060 |
+
|
7061 |
+
$args = array(
|
7062 |
+
'id' => 'font_family',
|
7063 |
+
'css_id' => $element_index.'_font_family',
|
7064 |
+
'parent' => $input_name.'[wck_password]',
|
7065 |
+
'title' => __('Font family','post-grid'),
|
7066 |
+
'details' => __('Set font family.','post-grid'),
|
7067 |
+
'type' => 'text',
|
7068 |
+
'value' => $font_family,
|
7069 |
+
'default' => '',
|
7070 |
+
'placeholder' => 'Open Sans',
|
7071 |
+
);
|
7072 |
+
|
7073 |
+
$settings_tabs_field->generate_field($args);
|
7074 |
+
|
7075 |
+
|
7076 |
+
$args = array(
|
7077 |
+
'id' => 'margin',
|
7078 |
+
'css_id' => $element_index.'_margin',
|
7079 |
+
'parent' => $input_name.'[wck_password]',
|
7080 |
+
'title' => __('Margin','post-grid'),
|
7081 |
+
'details' => __('Set margin.','post-grid'),
|
7082 |
+
'type' => 'text',
|
7083 |
+
'value' => $margin,
|
7084 |
+
'default' => '',
|
7085 |
+
'placeholder' => '5px 0',
|
7086 |
+
);
|
7087 |
+
|
7088 |
+
$settings_tabs_field->generate_field($args);
|
7089 |
+
|
7090 |
+
|
7091 |
+
$args = array(
|
7092 |
+
'id' => 'text_align',
|
7093 |
+
'css_id' => $element_index.'_text_align',
|
7094 |
+
'parent' => $input_name.'[wck_password]',
|
7095 |
+
'title' => __('Text align','post-grid'),
|
7096 |
+
'details' => __('Choose text align.','post-grid'),
|
7097 |
+
'type' => 'select',
|
7098 |
+
'value' => $text_align,
|
7099 |
+
'default' => 'left',
|
7100 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
7101 |
+
);
|
7102 |
+
|
7103 |
+
$settings_tabs_field->generate_field($args);
|
7104 |
+
|
7105 |
+
|
7106 |
+
$args = array(
|
7107 |
+
'id' => 'css',
|
7108 |
+
'css_id' => $element_index.'_css',
|
7109 |
+
'parent' => $input_name.'[wck_password]',
|
7110 |
+
'title' => __('Custom CSS','post-grid'),
|
7111 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
7112 |
+
'type' => 'textarea',
|
7113 |
+
'value' => $css,
|
7114 |
+
'default' => '',
|
7115 |
+
'placeholder' => '',
|
7116 |
+
);
|
7117 |
+
|
7118 |
+
$settings_tabs_field->generate_field($args);
|
7119 |
+
|
7120 |
+
$args = array(
|
7121 |
+
'id' => 'css_hover',
|
7122 |
+
'css_id' => $element_index.'_css_hover',
|
7123 |
+
'parent' => $input_name.'[wck_password]',
|
7124 |
+
'title' => __('Hover CSS','post-grid'),
|
7125 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
7126 |
+
'type' => 'textarea',
|
7127 |
+
'value' => $css_hover,
|
7128 |
+
'default' => '',
|
7129 |
+
'placeholder' => '',
|
7130 |
+
);
|
7131 |
+
|
7132 |
+
$settings_tabs_field->generate_field($args);
|
7133 |
+
|
7134 |
+
|
7135 |
+
ob_start();
|
7136 |
+
?>
|
7137 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
7138 |
+
<?php
|
7139 |
+
|
7140 |
+
$html = ob_get_clean();
|
7141 |
+
|
7142 |
+
$args = array(
|
7143 |
+
'id' => 'use_css',
|
7144 |
+
'title' => __('Use of CSS','post-grid'),
|
7145 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
7146 |
+
'type' => 'custom_html',
|
7147 |
+
'html' => $html,
|
7148 |
+
|
7149 |
+
);
|
7150 |
+
|
7151 |
+
$settings_tabs_field->generate_field($args);
|
7152 |
+
|
7153 |
+
?>
|
7154 |
+
|
7155 |
+
</div>
|
7156 |
+
</div>
|
7157 |
+
<?php
|
7158 |
+
|
7159 |
+
}
|
7160 |
+
|
7161 |
+
|
7162 |
+
|
7163 |
+
add_action('post_grid_layout_element_wck_password', 'post_grid_layout_element_wck_password');
|
7164 |
+
function post_grid_layout_element_wck_password($args){
|
7165 |
+
|
7166 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7167 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
7168 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
7169 |
+
|
7170 |
+
if(empty($post_id)) return;
|
7171 |
+
|
7172 |
+
$title = get_the_title($post_id);
|
7173 |
+
|
7174 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
7175 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
7176 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
7177 |
+
|
7178 |
+
|
7179 |
+
|
7180 |
+
//var_dump($wck_key);
|
7181 |
+
|
7182 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
7183 |
+
|
7184 |
+
if(!empty($wck_value)):
|
7185 |
+
$wck_value = sprintf($wrapper_html, $wck_value );
|
7186 |
+
|
7187 |
+
?>
|
7188 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_password ">
|
7189 |
+
<?php echo ($wck_value); ?>
|
7190 |
+
</div>
|
7191 |
+
<?php
|
7192 |
+
endif;
|
7193 |
+
|
7194 |
+
}
|
7195 |
+
|
7196 |
+
|
7197 |
+
|
7198 |
+
add_action('post_grid_layout_element_css_wck_password', 'post_grid_layout_element_css_wck_password', 10);
|
7199 |
+
function post_grid_layout_element_css_wck_password($args){
|
7200 |
+
|
7201 |
+
|
7202 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
7203 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7204 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
7205 |
+
|
7206 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
7207 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
7208 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
7209 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
7210 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
7211 |
+
|
7212 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
7213 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
7214 |
+
|
7215 |
+
?>
|
7216 |
+
<style type="text/css">
|
7217 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
7218 |
+
<?php if(!empty($color)): ?>
|
7219 |
+
color: <?php echo $color; ?>;
|
7220 |
+
<?php endif; ?>
|
7221 |
+
<?php if(!empty($font_size)): ?>
|
7222 |
+
font-size: <?php echo $font_size; ?>;
|
7223 |
+
<?php endif; ?>
|
7224 |
+
<?php if(!empty($font_family)): ?>
|
7225 |
+
font-family: <?php echo $font_family; ?>;
|
7226 |
+
<?php endif; ?>
|
7227 |
+
<?php if(!empty($margin)): ?>
|
7228 |
+
margin: <?php echo $margin; ?>;
|
7229 |
+
<?php endif; ?>
|
7230 |
+
<?php if(!empty($text_align)): ?>
|
7231 |
+
text-align: <?php echo $text_align; ?>;
|
7232 |
+
<?php endif; ?>
|
7233 |
+
<?php if(!empty($css)): ?>
|
7234 |
+
<?php echo $css; ?>
|
7235 |
+
<?php endif; ?>
|
7236 |
+
}
|
7237 |
+
<?php if(!empty($css_hover)): ?>
|
7238 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
7239 |
+
<?php echo $css_hover; ?>
|
7240 |
+
}
|
7241 |
+
<?php endif; ?>
|
7242 |
+
</style>
|
7243 |
+
<?php
|
7244 |
+
}
|
7245 |
+
|
7246 |
+
|
7247 |
+
add_action('post_grid_layout_element_option_wck_relationship','post_grid_layout_element_option_wck_relationship');
|
7248 |
+
function post_grid_layout_element_option_wck_relationship($parameters){
|
7249 |
+
|
7250 |
+
$settings_tabs_field = new settings_tabs_field();
|
7251 |
+
|
7252 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
7253 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
7254 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
7255 |
+
|
7256 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
7257 |
+
$item_wrapper_html = !empty($element_data['item_wrapper_html']) ? $element_data['item_wrapper_html'] : '%s';
|
7258 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
7259 |
+
|
7260 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
7261 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
7262 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
7263 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
7264 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
7265 |
+
|
7266 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
7267 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
7268 |
+
|
7269 |
+
|
7270 |
+
|
7271 |
+
?>
|
7272 |
+
<div class="item">
|
7273 |
+
<div class="element-title header ">
|
7274 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
7275 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
7276 |
+
|
7277 |
+
<span class="expand"><?php echo __('WCK Relationship','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
7278 |
+
</div>
|
7279 |
+
<div class="element-options options">
|
7280 |
+
|
7281 |
+
<?php
|
7282 |
+
|
7283 |
+
$args = array(
|
7284 |
+
'id' => 'wck_key',
|
7285 |
+
'css_id' => $element_index.'_text',
|
7286 |
+
'parent' => $input_name.'[wck_relationship]',
|
7287 |
+
'title' => __('WCK key','post-grid'),
|
7288 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
7289 |
+
'type' => 'text',
|
7290 |
+
'value' => $wck_key,
|
7291 |
+
'default' => '',
|
7292 |
+
'placeholder' => '',
|
7293 |
+
);
|
7294 |
+
|
7295 |
+
$settings_tabs_field->generate_field($args);
|
7296 |
+
|
7297 |
+
$args = array(
|
7298 |
+
'id' => 'item_wrapper_html',
|
7299 |
+
'css_id' => $element_index.'_wrapper_html',
|
7300 |
+
'parent' => $input_name.'[wck_relationship]',
|
7301 |
+
'title' => __('Item wrapper html','post-grid'),
|
7302 |
+
'details' => __('Write item wrapper html, list item example <br>Post title <code><li>{post_title}</li></code><br> Title link: <code><li><a href="{permalink}">{post_title}</a> </li></code> <br> Post parameters<br> {ID}, {post_author}, {post_date}, {post_date_gmt}, {post_content}, {post_title}, {post_excerpt}, {post_status}, {comment_status}, {ping_status},{post_password}, {post_name}, {post_type}, {comment_count}, {permalink}','post-grid'),
|
7303 |
+
'type' => 'text',
|
7304 |
+
'value' => $item_wrapper_html,
|
7305 |
+
'default' => '',
|
7306 |
+
'placeholder' => 'Value: %s',
|
7307 |
+
);
|
7308 |
+
|
7309 |
+
$settings_tabs_field->generate_field($args);
|
7310 |
+
|
7311 |
+
|
7312 |
+
$args = array(
|
7313 |
+
'id' => 'wrapper_html',
|
7314 |
+
'css_id' => $element_index.'_wrapper_html',
|
7315 |
+
'parent' => $input_name.'[wck_relationship]',
|
7316 |
+
'title' => __('Wrapper html','post-grid'),
|
7317 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Value: %s</code>, <code>Values: %s</code> list item wrapper ex: <code><ul>%s</ul></code>','post-grid'),
|
7318 |
+
'type' => 'text',
|
7319 |
+
'value' => $wrapper_html,
|
7320 |
+
'default' => '',
|
7321 |
+
'placeholder' => 'Value: %s',
|
7322 |
+
);
|
7323 |
+
|
7324 |
+
$settings_tabs_field->generate_field($args);
|
7325 |
+
|
7326 |
+
$args = array(
|
7327 |
+
'id' => 'color',
|
7328 |
+
'css_id' => $element_index.'_wck_relationship',
|
7329 |
+
'parent' => $input_name.'[wck_relationship]',
|
7330 |
+
'title' => __('Color','post-grid'),
|
7331 |
+
'details' => __('Title text color.','post-grid'),
|
7332 |
+
'type' => 'colorpicker',
|
7333 |
+
'value' => $color,
|
7334 |
+
'default' => '',
|
7335 |
+
);
|
7336 |
+
|
7337 |
+
$settings_tabs_field->generate_field($args);
|
7338 |
+
|
7339 |
+
$args = array(
|
7340 |
+
'id' => 'font_size',
|
7341 |
+
'css_id' => $element_index.'_font_size',
|
7342 |
+
'parent' => $input_name.'[wck_relationship]',
|
7343 |
+
'title' => __('Font size','post-grid'),
|
7344 |
+
'details' => __('Set font size.','post-grid'),
|
7345 |
+
'type' => 'text',
|
7346 |
+
'value' => $font_size,
|
7347 |
+
'default' => '',
|
7348 |
+
'placeholder' => '14px',
|
7349 |
+
);
|
7350 |
+
|
7351 |
+
$settings_tabs_field->generate_field($args);
|
7352 |
+
|
7353 |
+
|
7354 |
+
$args = array(
|
7355 |
+
'id' => 'font_family',
|
7356 |
+
'css_id' => $element_index.'_font_family',
|
7357 |
+
'parent' => $input_name.'[wck_relationship]',
|
7358 |
+
'title' => __('Font family','post-grid'),
|
7359 |
+
'details' => __('Set font family.','post-grid'),
|
7360 |
+
'type' => 'text',
|
7361 |
+
'value' => $font_family,
|
7362 |
+
'default' => '',
|
7363 |
+
'placeholder' => 'Open Sans',
|
7364 |
+
);
|
7365 |
+
|
7366 |
+
$settings_tabs_field->generate_field($args);
|
7367 |
+
|
7368 |
+
|
7369 |
+
$args = array(
|
7370 |
+
'id' => 'margin',
|
7371 |
+
'css_id' => $element_index.'_margin',
|
7372 |
+
'parent' => $input_name.'[wck_relationship]',
|
7373 |
+
'title' => __('Margin','post-grid'),
|
7374 |
+
'details' => __('Set margin.','post-grid'),
|
7375 |
+
'type' => 'text',
|
7376 |
+
'value' => $margin,
|
7377 |
+
'default' => '',
|
7378 |
+
'placeholder' => '5px 0',
|
7379 |
+
);
|
7380 |
+
|
7381 |
+
$settings_tabs_field->generate_field($args);
|
7382 |
+
|
7383 |
+
|
7384 |
+
$args = array(
|
7385 |
+
'id' => 'text_align',
|
7386 |
+
'css_id' => $element_index.'_text_align',
|
7387 |
+
'parent' => $input_name.'[wck_relationship]',
|
7388 |
+
'title' => __('Text align','post-grid'),
|
7389 |
+
'details' => __('Choose text align.','post-grid'),
|
7390 |
+
'type' => 'select',
|
7391 |
+
'value' => $text_align,
|
7392 |
+
'default' => 'left',
|
7393 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
7394 |
+
);
|
7395 |
+
|
7396 |
+
$settings_tabs_field->generate_field($args);
|
7397 |
+
|
7398 |
+
|
7399 |
+
$args = array(
|
7400 |
+
'id' => 'css',
|
7401 |
+
'css_id' => $element_index.'_css',
|
7402 |
+
'parent' => $input_name.'[wck_relationship]',
|
7403 |
+
'title' => __('Custom CSS','post-grid'),
|
7404 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
7405 |
+
'type' => 'textarea',
|
7406 |
+
'value' => $css,
|
7407 |
+
'default' => '',
|
7408 |
+
'placeholder' => '',
|
7409 |
+
);
|
7410 |
+
|
7411 |
+
$settings_tabs_field->generate_field($args);
|
7412 |
+
|
7413 |
+
$args = array(
|
7414 |
+
'id' => 'css_hover',
|
7415 |
+
'css_id' => $element_index.'_css_hover',
|
7416 |
+
'parent' => $input_name.'[wck_relationship]',
|
7417 |
+
'title' => __('Hover CSS','post-grid'),
|
7418 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
7419 |
+
'type' => 'textarea',
|
7420 |
+
'value' => $css_hover,
|
7421 |
+
'default' => '',
|
7422 |
+
'placeholder' => '',
|
7423 |
+
);
|
7424 |
+
|
7425 |
+
$settings_tabs_field->generate_field($args);
|
7426 |
+
|
7427 |
+
|
7428 |
+
ob_start();
|
7429 |
+
?>
|
7430 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
7431 |
+
<?php
|
7432 |
+
|
7433 |
+
$html = ob_get_clean();
|
7434 |
+
|
7435 |
+
$args = array(
|
7436 |
+
'id' => 'use_css',
|
7437 |
+
'title' => __('Use of CSS','post-grid'),
|
7438 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
7439 |
+
'type' => 'custom_html',
|
7440 |
+
'html' => $html,
|
7441 |
+
|
7442 |
+
);
|
7443 |
+
|
7444 |
+
$settings_tabs_field->generate_field($args);
|
7445 |
+
|
7446 |
+
?>
|
7447 |
+
|
7448 |
+
</div>
|
7449 |
+
</div>
|
7450 |
+
<?php
|
7451 |
+
|
7452 |
+
}
|
7453 |
+
|
7454 |
+
|
7455 |
+
|
7456 |
+
add_action('post_grid_layout_element_wck_relationship', 'post_grid_layout_element_wck_relationship');
|
7457 |
+
function post_grid_layout_element_wck_relationship($args){
|
7458 |
+
|
7459 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7460 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
7461 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
7462 |
+
|
7463 |
+
if(empty($post_id)) return;
|
7464 |
+
|
7465 |
+
$title = get_the_title($post_id);
|
7466 |
+
|
7467 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
7468 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
7469 |
+
$item_wrapper_html = !empty($element['item_wrapper_html']) ? $element['item_wrapper_html'] : '%s';
|
7470 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
7471 |
+
|
7472 |
+
|
7473 |
+
//var_dump($wck_key);
|
7474 |
+
|
7475 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
7476 |
+
|
7477 |
+
if(!empty($wck_value)):
|
7478 |
+
|
7479 |
+
//echo '<pre>'.var_export($wck_value, true).'</pre>';
|
7480 |
+
|
7481 |
+
|
7482 |
+
|
7483 |
+
//echo '<pre style="text-align: left">'.var_export($vars, true).'</pre>';
|
7484 |
+
|
7485 |
+
$post_html = '';
|
7486 |
+
|
7487 |
+
foreach( $wck_value as $post_item ):
|
7488 |
+
|
7489 |
+
$vars = array(
|
7490 |
+
'{ID}'=> isset($post_item->ID) ?$post_item->ID : '',
|
7491 |
+
'{post_author'=> isset($post_item->post_author) ?$post_item->post_author: '',
|
7492 |
+
'{post_date}'=> isset($post_item->post_date) ?$post_item->post_date : '',
|
7493 |
+
'{post_date_gmt}'=> isset($post_item->post_date_gmt) ?$post_item->post_date_gmt : '',
|
7494 |
+
'{post_content}'=> isset($post_item->post_content) ?$post_item->post_content : '',
|
7495 |
+
'{post_title}'=> isset($post_item->post_title) ?$post_item->post_title : '',
|
7496 |
+
'{post_excerpt}'=> isset($post_item->post_excerpt) ?$post_item->post_excerpt : '',
|
7497 |
+
'{post_status}'=> isset($post_item->post_status) ?$post_item->post_status: '',
|
7498 |
+
'{comment_status}'=> isset($post_item->comment_status) ?$post_item->comment_status : '',
|
7499 |
+
'{ping_status}'=> isset($post_item->ping_status) ?$post_item->ping_status : '',
|
7500 |
+
'{post_password}'=> isset($post_item->post_password) ?$post_item->post_password : '',
|
7501 |
+
'{post_name}'=> isset($post_item->post_name) ?$post_item->post_name : '',
|
7502 |
+
'{post_type}'=> isset($post_item->post_type) ?$post_item->post_type : '',
|
7503 |
+
'{comment_count}'=> isset($post_item->comment_count) ?$post_item->comment_count : '',
|
7504 |
+
'{permalink}'=> get_permalink( $post_item->ID ),
|
7505 |
+
|
7506 |
+
);
|
7507 |
+
|
7508 |
+
$post_html .= strtr($item_wrapper_html, $vars);
|
7509 |
+
|
7510 |
+
|
7511 |
+
endforeach;
|
7512 |
+
|
7513 |
+
$post_html = sprintf($wrapper_html, $post_html);
|
7514 |
+
|
7515 |
+
?>
|
7516 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_relationship ">
|
7517 |
+
<?php echo ($post_html); ?>
|
7518 |
+
</div>
|
7519 |
+
<?php
|
7520 |
+
endif;
|
7521 |
+
|
7522 |
+
}
|
7523 |
+
|
7524 |
+
|
7525 |
+
|
7526 |
+
add_action('post_grid_layout_element_css_wck_relationship', 'post_grid_layout_element_css_wck_relationship', 10);
|
7527 |
+
function post_grid_layout_element_css_wck_relationship($args){
|
7528 |
+
|
7529 |
+
|
7530 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
7531 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7532 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
7533 |
+
|
7534 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
7535 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
7536 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
7537 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
7538 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
7539 |
+
|
7540 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
7541 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
7542 |
+
|
7543 |
+
?>
|
7544 |
+
<style type="text/css">
|
7545 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
7546 |
+
<?php if(!empty($color)): ?>
|
7547 |
+
color: <?php echo $color; ?>;
|
7548 |
+
<?php endif; ?>
|
7549 |
+
<?php if(!empty($font_size)): ?>
|
7550 |
+
font-size: <?php echo $font_size; ?>;
|
7551 |
+
<?php endif; ?>
|
7552 |
+
<?php if(!empty($font_family)): ?>
|
7553 |
+
font-family: <?php echo $font_family; ?>;
|
7554 |
+
<?php endif; ?>
|
7555 |
+
<?php if(!empty($margin)): ?>
|
7556 |
+
margin: <?php echo $margin; ?>;
|
7557 |
+
<?php endif; ?>
|
7558 |
+
<?php if(!empty($text_align)): ?>
|
7559 |
+
text-align: <?php echo $text_align; ?>;
|
7560 |
+
<?php endif; ?>
|
7561 |
+
<?php if(!empty($css)): ?>
|
7562 |
+
<?php echo $css; ?>
|
7563 |
+
<?php endif; ?>
|
7564 |
+
}
|
7565 |
+
<?php if(!empty($css_hover)): ?>
|
7566 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
7567 |
+
<?php echo $css_hover; ?>
|
7568 |
+
}
|
7569 |
+
<?php endif; ?>
|
7570 |
+
</style>
|
7571 |
+
<?php
|
7572 |
+
}
|
7573 |
+
|
7574 |
+
|
7575 |
+
|
7576 |
+
add_action('post_grid_layout_element_option_wck_true_false','post_grid_layout_element_option_wck_true_false');
|
7577 |
+
function post_grid_layout_element_option_wck_true_false($parameters){
|
7578 |
+
|
7579 |
+
$settings_tabs_field = new settings_tabs_field();
|
7580 |
+
|
7581 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
7582 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
7583 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
7584 |
+
|
7585 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
7586 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
7587 |
+
|
7588 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
7589 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
7590 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
7591 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
7592 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
7593 |
+
|
7594 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
7595 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
7596 |
+
|
7597 |
+
|
7598 |
+
|
7599 |
+
?>
|
7600 |
+
<div class="item">
|
7601 |
+
<div class="element-title header ">
|
7602 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
7603 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
7604 |
+
|
7605 |
+
<span class="expand"><?php echo __('WCK Text','post-grid'); ?> - <?php echo $wck_key; ?></span>
|
7606 |
+
</div>
|
7607 |
+
<div class="element-options options">
|
7608 |
+
|
7609 |
+
<?php
|
7610 |
+
|
7611 |
+
$args = array(
|
7612 |
+
'id' => 'wck_key',
|
7613 |
+
'css_id' => $element_index.'_text',
|
7614 |
+
'parent' => $input_name.'[wck_true_false]',
|
7615 |
+
'title' => __('WCK key','post-grid'),
|
7616 |
+
'details' => __('Write WCK meta key or field name.','post-grid'),
|
7617 |
+
'type' => 'text',
|
7618 |
+
'value' => $wck_key,
|
7619 |
+
'default' => '',
|
7620 |
+
'placeholder' => '',
|
7621 |
+
);
|
7622 |
+
|
7623 |
+
$settings_tabs_field->generate_field($args);
|
7624 |
+
|
7625 |
+
|
7626 |
+
$args = array(
|
7627 |
+
'id' => 'wrapper_html',
|
7628 |
+
'css_id' => $element_index.'_wrapper_html',
|
7629 |
+
'parent' => $input_name.'[wck_true_false]',
|
7630 |
+
'title' => __('Wrapper html','post-grid'),
|
7631 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Values: %s</code> <code>Is true: Yes</code> ','post-grid'),
|
7632 |
+
'type' => 'text',
|
7633 |
+
'value' => $wrapper_html,
|
7634 |
+
'default' => '',
|
7635 |
+
'placeholder' => 'Value: %s',
|
7636 |
+
);
|
7637 |
+
|
7638 |
+
$settings_tabs_field->generate_field($args);
|
7639 |
+
|
7640 |
+
|
7641 |
+
$args = array(
|
7642 |
+
'id' => 'color',
|
7643 |
+
'css_id' => $element_index.'_wck_true_false',
|
7644 |
+
'parent' => $input_name.'[wck_true_false]',
|
7645 |
+
'title' => __('Color','post-grid'),
|
7646 |
+
'details' => __('Title text color.','post-grid'),
|
7647 |
+
'type' => 'colorpicker',
|
7648 |
+
'value' => $color,
|
7649 |
+
'default' => '',
|
7650 |
+
);
|
7651 |
+
|
7652 |
+
$settings_tabs_field->generate_field($args);
|
7653 |
+
|
7654 |
+
$args = array(
|
7655 |
+
'id' => 'font_size',
|
7656 |
+
'css_id' => $element_index.'_font_size',
|
7657 |
+
'parent' => $input_name.'[wck_true_false]',
|
7658 |
+
'title' => __('Font size','post-grid'),
|
7659 |
+
'details' => __('Set font size.','post-grid'),
|
7660 |
+
'type' => 'text',
|
7661 |
+
'value' => $font_size,
|
7662 |
+
'default' => '',
|
7663 |
+
'placeholder' => '14px',
|
7664 |
+
);
|
7665 |
+
|
7666 |
+
$settings_tabs_field->generate_field($args);
|
7667 |
+
|
7668 |
+
|
7669 |
+
$args = array(
|
7670 |
+
'id' => 'font_family',
|
7671 |
+
'css_id' => $element_index.'_font_family',
|
7672 |
+
'parent' => $input_name.'[wck_true_false]',
|
7673 |
+
'title' => __('Font family','post-grid'),
|
7674 |
+
'details' => __('Set font family.','post-grid'),
|
7675 |
+
'type' => 'text',
|
7676 |
+
'value' => $font_family,
|
7677 |
+
'default' => '',
|
7678 |
+
'placeholder' => 'Open Sans',
|
7679 |
+
);
|
7680 |
+
|
7681 |
+
$settings_tabs_field->generate_field($args);
|
7682 |
+
|
7683 |
+
|
7684 |
+
$args = array(
|
7685 |
+
'id' => 'margin',
|
7686 |
+
'css_id' => $element_index.'_margin',
|
7687 |
+
'parent' => $input_name.'[wck_true_false]',
|
7688 |
+
'title' => __('Margin','post-grid'),
|
7689 |
+
'details' => __('Set margin.','post-grid'),
|
7690 |
+
'type' => 'text',
|
7691 |
+
'value' => $margin,
|
7692 |
+
'default' => '',
|
7693 |
+
'placeholder' => '5px 0',
|
7694 |
+
);
|
7695 |
+
|
7696 |
+
$settings_tabs_field->generate_field($args);
|
7697 |
+
|
7698 |
+
|
7699 |
+
$args = array(
|
7700 |
+
'id' => 'text_align',
|
7701 |
+
'css_id' => $element_index.'_text_align',
|
7702 |
+
'parent' => $input_name.'[wck_true_false]',
|
7703 |
+
'title' => __('Text align','post-grid'),
|
7704 |
+
'details' => __('Choose text align.','post-grid'),
|
7705 |
+
'type' => 'select',
|
7706 |
+
'value' => $text_align,
|
7707 |
+
'default' => 'left',
|
7708 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
7709 |
+
);
|
7710 |
+
|
7711 |
+
$settings_tabs_field->generate_field($args);
|
7712 |
+
|
7713 |
+
|
7714 |
+
$args = array(
|
7715 |
+
'id' => 'css',
|
7716 |
+
'css_id' => $element_index.'_css',
|
7717 |
+
'parent' => $input_name.'[wck_true_false]',
|
7718 |
+
'title' => __('Custom CSS','post-grid'),
|
7719 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
7720 |
+
'type' => 'textarea',
|
7721 |
+
'value' => $css,
|
7722 |
+
'default' => '',
|
7723 |
+
'placeholder' => '',
|
7724 |
+
);
|
7725 |
+
|
7726 |
+
$settings_tabs_field->generate_field($args);
|
7727 |
+
|
7728 |
+
$args = array(
|
7729 |
+
'id' => 'css_hover',
|
7730 |
+
'css_id' => $element_index.'_css_hover',
|
7731 |
+
'parent' => $input_name.'[wck_true_false]',
|
7732 |
+
'title' => __('Hover CSS','post-grid'),
|
7733 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
7734 |
+
'type' => 'textarea',
|
7735 |
+
'value' => $css_hover,
|
7736 |
+
'default' => '',
|
7737 |
+
'placeholder' => '',
|
7738 |
+
);
|
7739 |
+
|
7740 |
+
$settings_tabs_field->generate_field($args);
|
7741 |
+
|
7742 |
+
|
7743 |
+
ob_start();
|
7744 |
+
?>
|
7745 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
7746 |
+
<?php
|
7747 |
+
|
7748 |
+
$html = ob_get_clean();
|
7749 |
+
|
7750 |
+
$args = array(
|
7751 |
+
'id' => 'use_css',
|
7752 |
+
'title' => __('Use of CSS','post-grid'),
|
7753 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
7754 |
+
'type' => 'custom_html',
|
7755 |
+
'html' => $html,
|
7756 |
+
|
7757 |
+
);
|
7758 |
+
|
7759 |
+
$settings_tabs_field->generate_field($args);
|
7760 |
+
|
7761 |
+
?>
|
7762 |
+
|
7763 |
+
</div>
|
7764 |
+
</div>
|
7765 |
+
<?php
|
7766 |
+
|
7767 |
+
}
|
7768 |
+
|
7769 |
+
|
7770 |
+
|
7771 |
+
add_action('post_grid_layout_element_wck_true_false', 'post_grid_layout_element_wck_true_false');
|
7772 |
+
function post_grid_layout_element_wck_true_false($args){
|
7773 |
+
|
7774 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7775 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
7776 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
7777 |
+
|
7778 |
+
if(empty($post_id)) return;
|
7779 |
+
|
7780 |
+
$title = get_the_title($post_id);
|
7781 |
+
|
7782 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
7783 |
+
$wck_key = isset($element['wck_key']) ? $element['wck_key'] : '';
|
7784 |
+
$wrapper_html = !empty($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
7785 |
+
$boolean_html = !empty($element['boolean_html']) ? $element['boolean_html'] : '';
|
7786 |
+
|
7787 |
+
|
7788 |
+
|
7789 |
+
|
7790 |
+
//var_dump($wck_key);
|
7791 |
+
|
7792 |
+
$wck_value = get_post_meta($post_id, $wck_key, true );
|
7793 |
+
|
7794 |
+
if(!empty($wck_value)):
|
7795 |
+
$wck_value = sprintf($wrapper_html, $wck_value);
|
7796 |
+
|
7797 |
+
?>
|
7798 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wck_true_false ">
|
7799 |
+
<?php echo ($wck_value); ?>
|
7800 |
+
</div>
|
7801 |
+
<?php
|
7802 |
+
endif;
|
7803 |
+
|
7804 |
+
}
|
7805 |
+
|
7806 |
+
|
7807 |
+
|
7808 |
+
add_action('post_grid_layout_element_css_wck_true_false', 'post_grid_layout_element_css_wck_true_false', 10);
|
7809 |
+
function post_grid_layout_element_css_wck_true_false($args){
|
7810 |
+
|
7811 |
+
|
7812 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
7813 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
7814 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
7815 |
+
|
7816 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
7817 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
7818 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
7819 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
7820 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
7821 |
+
|
7822 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
7823 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
7824 |
+
|
7825 |
+
?>
|
7826 |
+
<style type="text/css">
|
7827 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
7828 |
+
<?php if(!empty($color)): ?>
|
7829 |
+
color: <?php echo $color; ?>;
|
7830 |
+
<?php endif; ?>
|
7831 |
+
<?php if(!empty($font_size)): ?>
|
7832 |
+
font-size: <?php echo $font_size; ?>;
|
7833 |
+
<?php endif; ?>
|
7834 |
+
<?php if(!empty($font_family)): ?>
|
7835 |
+
font-family: <?php echo $font_family; ?>;
|
7836 |
+
<?php endif; ?>
|
7837 |
+
<?php if(!empty($margin)): ?>
|
7838 |
+
margin: <?php echo $margin; ?>;
|
7839 |
+
<?php endif; ?>
|
7840 |
+
<?php if(!empty($text_align)): ?>
|
7841 |
+
text-align: <?php echo $text_align; ?>;
|
7842 |
+
<?php endif; ?>
|
7843 |
+
<?php if(!empty($css)): ?>
|
7844 |
+
<?php echo $css; ?>
|
7845 |
+
<?php endif; ?>
|
7846 |
+
}
|
7847 |
+
<?php if(!empty($css_hover)): ?>
|
7848 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
7849 |
+
<?php echo $css_hover; ?>
|
7850 |
+
}
|
7851 |
+
<?php endif; ?>
|
7852 |
+
</style>
|
7853 |
+
<?php
|
7854 |
+
}
|
includes/layout-elements/wp-job-manager/layout-elements.php
ADDED
@@ -0,0 +1,1340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('post_grid_layout_elements','post_grid_wpjobmanager_layout_elements', 5);
|
5 |
+
|
6 |
+
function post_grid_wpjobmanager_layout_elements($elements_group){
|
7 |
+
|
8 |
+
$elements_group['wpjobmanager'] = array(
|
9 |
+
'group_title'=>'WP Job Manager',
|
10 |
+
'items'=>array(
|
11 |
+
'wpjobmanager_location'=>array('name' =>__('Location','post-grid')),
|
12 |
+
'wpjobmanager_company_name'=>array('name' =>__('Company name','post-grid')),
|
13 |
+
'wpjobmanager_company_website'=>array('name' =>__('Company website','post-grid')),
|
14 |
+
'wpjobmanager_company_tagline'=>array('name' =>__('Company tagline','post-grid')),
|
15 |
+
'wpjobmanager_job_expires'=>array('name' =>__('Job expire date','post-grid')),
|
16 |
+
|
17 |
+
),
|
18 |
+
);
|
19 |
+
|
20 |
+
return $elements_group;
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
add_action('post_grid_layout_element_option_wpjobmanager_location','post_grid_layout_element_option_wpjobmanager_location');
|
28 |
+
function post_grid_layout_element_option_wpjobmanager_location($parameters){
|
29 |
+
|
30 |
+
$settings_tabs_field = new settings_tabs_field();
|
31 |
+
|
32 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
33 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
34 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
35 |
+
|
36 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
37 |
+
|
38 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
39 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
40 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
41 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
42 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
43 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
44 |
+
|
45 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
46 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
?>
|
51 |
+
<div class="item">
|
52 |
+
<div class="element-title header ">
|
53 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
54 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
55 |
+
|
56 |
+
<span class="expand"><?php echo __('Location','post-grid'); ?></span>
|
57 |
+
</div>
|
58 |
+
<div class="element-options options">
|
59 |
+
|
60 |
+
<?php
|
61 |
+
|
62 |
+
|
63 |
+
$args = array(
|
64 |
+
'id' => 'wrapper_html',
|
65 |
+
'css_id' => $element_index.'_wrapper_html',
|
66 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
67 |
+
'title' => __('Wrapper html','post-grid'),
|
68 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Email: <a href="mailto:%s">Send mail</a></code>','post-grid'),
|
69 |
+
'type' => 'text',
|
70 |
+
'value' => $wrapper_html,
|
71 |
+
'default' => '',
|
72 |
+
'placeholder' => 'Email: %s',
|
73 |
+
);
|
74 |
+
|
75 |
+
$settings_tabs_field->generate_field($args);
|
76 |
+
|
77 |
+
$args = array(
|
78 |
+
'id' => 'color',
|
79 |
+
'css_id' => $element_index.'_wpjobmanager_location',
|
80 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
81 |
+
'title' => __('Color','post-grid'),
|
82 |
+
'details' => __('Title text color.','post-grid'),
|
83 |
+
'type' => 'colorpicker',
|
84 |
+
'value' => $color,
|
85 |
+
'default' => '',
|
86 |
+
);
|
87 |
+
|
88 |
+
$settings_tabs_field->generate_field($args);
|
89 |
+
|
90 |
+
$args = array(
|
91 |
+
'id' => 'font_size',
|
92 |
+
'css_id' => $element_index.'_font_size',
|
93 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
94 |
+
'title' => __('Font size','post-grid'),
|
95 |
+
'details' => __('Set font size.','post-grid'),
|
96 |
+
'type' => 'text',
|
97 |
+
'value' => $font_size,
|
98 |
+
'default' => '',
|
99 |
+
'placeholder' => '14px',
|
100 |
+
);
|
101 |
+
|
102 |
+
$settings_tabs_field->generate_field($args);
|
103 |
+
|
104 |
+
|
105 |
+
$args = array(
|
106 |
+
'id' => 'font_family',
|
107 |
+
'css_id' => $element_index.'_font_family',
|
108 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
109 |
+
'title' => __('Font family','post-grid'),
|
110 |
+
'details' => __('Set font family.','post-grid'),
|
111 |
+
'type' => 'text',
|
112 |
+
'value' => $font_family,
|
113 |
+
'default' => '',
|
114 |
+
'placeholder' => 'Open Sans',
|
115 |
+
);
|
116 |
+
|
117 |
+
$settings_tabs_field->generate_field($args);
|
118 |
+
|
119 |
+
|
120 |
+
$args = array(
|
121 |
+
'id' => 'margin',
|
122 |
+
'css_id' => $element_index.'_margin',
|
123 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
124 |
+
'title' => __('Margin','post-grid'),
|
125 |
+
'details' => __('Set margin.','post-grid'),
|
126 |
+
'type' => 'text',
|
127 |
+
'value' => $margin,
|
128 |
+
'default' => '',
|
129 |
+
'placeholder' => '5px 0',
|
130 |
+
);
|
131 |
+
|
132 |
+
$settings_tabs_field->generate_field($args);
|
133 |
+
|
134 |
+
|
135 |
+
$args = array(
|
136 |
+
'id' => 'text_align',
|
137 |
+
'css_id' => $element_index.'_text_align',
|
138 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
139 |
+
'title' => __('Text align','post-grid'),
|
140 |
+
'details' => __('Choose text align.','post-grid'),
|
141 |
+
'type' => 'select',
|
142 |
+
'value' => $text_align,
|
143 |
+
'default' => 'left',
|
144 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
145 |
+
);
|
146 |
+
|
147 |
+
$settings_tabs_field->generate_field($args);
|
148 |
+
|
149 |
+
|
150 |
+
$args = array(
|
151 |
+
'id' => 'css',
|
152 |
+
'css_id' => $element_index.'_css',
|
153 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
154 |
+
'title' => __('Custom CSS','post-grid'),
|
155 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
156 |
+
'type' => 'textarea',
|
157 |
+
'value' => $css,
|
158 |
+
'default' => '',
|
159 |
+
'placeholder' => '',
|
160 |
+
);
|
161 |
+
|
162 |
+
$settings_tabs_field->generate_field($args);
|
163 |
+
|
164 |
+
$args = array(
|
165 |
+
'id' => 'css_hover',
|
166 |
+
'css_id' => $element_index.'_css_hover',
|
167 |
+
'parent' => $input_name.'[wpjobmanager_location]',
|
168 |
+
'title' => __('Hover CSS','post-grid'),
|
169 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
170 |
+
'type' => 'textarea',
|
171 |
+
'value' => $css_hover,
|
172 |
+
'default' => '',
|
173 |
+
'placeholder' => '',
|
174 |
+
);
|
175 |
+
|
176 |
+
$settings_tabs_field->generate_field($args);
|
177 |
+
|
178 |
+
|
179 |
+
ob_start();
|
180 |
+
?>
|
181 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
182 |
+
<?php
|
183 |
+
|
184 |
+
$html = ob_get_clean();
|
185 |
+
|
186 |
+
$args = array(
|
187 |
+
'id' => 'use_css',
|
188 |
+
'title' => __('Use of CSS','post-grid'),
|
189 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
190 |
+
'type' => 'custom_html',
|
191 |
+
'html' => $html,
|
192 |
+
|
193 |
+
);
|
194 |
+
|
195 |
+
$settings_tabs_field->generate_field($args);
|
196 |
+
|
197 |
+
?>
|
198 |
+
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
<?php
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
add_action('post_grid_layout_element_wpjobmanager_location', 'post_grid_layout_element_wpjobmanager_location');
|
208 |
+
function post_grid_layout_element_wpjobmanager_location($args){
|
209 |
+
|
210 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
211 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
212 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
213 |
+
|
214 |
+
if(empty($post_id)) return;
|
215 |
+
|
216 |
+
$title = get_the_title($post_id);
|
217 |
+
|
218 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
219 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
220 |
+
|
221 |
+
|
222 |
+
|
223 |
+
//var_dump($wck_key);
|
224 |
+
|
225 |
+
$meta_value = get_post_meta($post_id, '_job_location', true );
|
226 |
+
|
227 |
+
if(!empty($meta_value)):
|
228 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
229 |
+
|
230 |
+
?>
|
231 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wpjobmanager_location ">
|
232 |
+
<?php echo ($meta_value); ?>
|
233 |
+
</div>
|
234 |
+
<?php
|
235 |
+
endif;
|
236 |
+
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
|
241 |
+
add_action('post_grid_layout_element_css_wpjobmanager_location', 'post_grid_layout_element_css_wpjobmanager_location', 10);
|
242 |
+
function post_grid_layout_element_css_wpjobmanager_location($args){
|
243 |
+
|
244 |
+
|
245 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
246 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
247 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
248 |
+
|
249 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
250 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
251 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
252 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
253 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
254 |
+
|
255 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
256 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
257 |
+
|
258 |
+
?>
|
259 |
+
<style type="text/css">
|
260 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
261 |
+
<?php if(!empty($color)): ?>
|
262 |
+
color: <?php echo $color; ?>;
|
263 |
+
<?php endif; ?>
|
264 |
+
<?php if(!empty($font_size)): ?>
|
265 |
+
font-size: <?php echo $font_size; ?>;
|
266 |
+
<?php endif; ?>
|
267 |
+
<?php if(!empty($font_family)): ?>
|
268 |
+
font-family: <?php echo $font_family; ?>;
|
269 |
+
<?php endif; ?>
|
270 |
+
<?php if(!empty($margin)): ?>
|
271 |
+
margin: <?php echo $margin; ?>;
|
272 |
+
<?php endif; ?>
|
273 |
+
<?php if(!empty($text_align)): ?>
|
274 |
+
text-align: <?php echo $text_align; ?>;
|
275 |
+
<?php endif; ?>
|
276 |
+
<?php if(!empty($css)): ?>
|
277 |
+
<?php echo $css; ?>
|
278 |
+
<?php endif; ?>
|
279 |
+
}
|
280 |
+
<?php if(!empty($css_hover)): ?>
|
281 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
282 |
+
<?php echo $css_hover; ?>
|
283 |
+
}
|
284 |
+
<?php endif; ?>
|
285 |
+
</style>
|
286 |
+
<?php
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
add_action('post_grid_layout_element_option_wpjobmanager_company_name','post_grid_layout_element_option_wpjobmanager_company_name');
|
291 |
+
function post_grid_layout_element_option_wpjobmanager_company_name($parameters){
|
292 |
+
|
293 |
+
$settings_tabs_field = new settings_tabs_field();
|
294 |
+
|
295 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
296 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
297 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
298 |
+
|
299 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
300 |
+
|
301 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
302 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
303 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
304 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
305 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
306 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
307 |
+
|
308 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
309 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
310 |
+
|
311 |
+
|
312 |
+
|
313 |
+
?>
|
314 |
+
<div class="item">
|
315 |
+
<div class="element-title header ">
|
316 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
317 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
318 |
+
|
319 |
+
<span class="expand"><?php echo __('Company Name','post-grid'); ?></span>
|
320 |
+
</div>
|
321 |
+
<div class="element-options options">
|
322 |
+
|
323 |
+
<?php
|
324 |
+
|
325 |
+
|
326 |
+
$args = array(
|
327 |
+
'id' => 'wrapper_html',
|
328 |
+
'css_id' => $element_index.'_wrapper_html',
|
329 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
330 |
+
'title' => __('Wrapper html','post-grid'),
|
331 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Company name: %s</code>','post-grid'),
|
332 |
+
'type' => 'text',
|
333 |
+
'value' => $wrapper_html,
|
334 |
+
'default' => '',
|
335 |
+
'placeholder' => 'Company name: %s',
|
336 |
+
);
|
337 |
+
|
338 |
+
$settings_tabs_field->generate_field($args);
|
339 |
+
|
340 |
+
$args = array(
|
341 |
+
'id' => 'color',
|
342 |
+
'css_id' => $element_index.'_wpjobmanager_company_name',
|
343 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
344 |
+
'title' => __('Color','post-grid'),
|
345 |
+
'details' => __('Title text color.','post-grid'),
|
346 |
+
'type' => 'colorpicker',
|
347 |
+
'value' => $color,
|
348 |
+
'default' => '',
|
349 |
+
);
|
350 |
+
|
351 |
+
$settings_tabs_field->generate_field($args);
|
352 |
+
|
353 |
+
$args = array(
|
354 |
+
'id' => 'font_size',
|
355 |
+
'css_id' => $element_index.'_font_size',
|
356 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
357 |
+
'title' => __('Font size','post-grid'),
|
358 |
+
'details' => __('Set font size.','post-grid'),
|
359 |
+
'type' => 'text',
|
360 |
+
'value' => $font_size,
|
361 |
+
'default' => '',
|
362 |
+
'placeholder' => '14px',
|
363 |
+
);
|
364 |
+
|
365 |
+
$settings_tabs_field->generate_field($args);
|
366 |
+
|
367 |
+
|
368 |
+
$args = array(
|
369 |
+
'id' => 'font_family',
|
370 |
+
'css_id' => $element_index.'_font_family',
|
371 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
372 |
+
'title' => __('Font family','post-grid'),
|
373 |
+
'details' => __('Set font family.','post-grid'),
|
374 |
+
'type' => 'text',
|
375 |
+
'value' => $font_family,
|
376 |
+
'default' => '',
|
377 |
+
'placeholder' => 'Open Sans',
|
378 |
+
);
|
379 |
+
|
380 |
+
$settings_tabs_field->generate_field($args);
|
381 |
+
|
382 |
+
|
383 |
+
$args = array(
|
384 |
+
'id' => 'margin',
|
385 |
+
'css_id' => $element_index.'_margin',
|
386 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
387 |
+
'title' => __('Margin','post-grid'),
|
388 |
+
'details' => __('Set margin.','post-grid'),
|
389 |
+
'type' => 'text',
|
390 |
+
'value' => $margin,
|
391 |
+
'default' => '',
|
392 |
+
'placeholder' => '5px 0',
|
393 |
+
);
|
394 |
+
|
395 |
+
$settings_tabs_field->generate_field($args);
|
396 |
+
|
397 |
+
|
398 |
+
$args = array(
|
399 |
+
'id' => 'text_align',
|
400 |
+
'css_id' => $element_index.'_text_align',
|
401 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
402 |
+
'title' => __('Text align','post-grid'),
|
403 |
+
'details' => __('Choose text align.','post-grid'),
|
404 |
+
'type' => 'select',
|
405 |
+
'value' => $text_align,
|
406 |
+
'default' => 'left',
|
407 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
408 |
+
);
|
409 |
+
|
410 |
+
$settings_tabs_field->generate_field($args);
|
411 |
+
|
412 |
+
|
413 |
+
$args = array(
|
414 |
+
'id' => 'css',
|
415 |
+
'css_id' => $element_index.'_css',
|
416 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
417 |
+
'title' => __('Custom CSS','post-grid'),
|
418 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
419 |
+
'type' => 'textarea',
|
420 |
+
'value' => $css,
|
421 |
+
'default' => '',
|
422 |
+
'placeholder' => '',
|
423 |
+
);
|
424 |
+
|
425 |
+
$settings_tabs_field->generate_field($args);
|
426 |
+
|
427 |
+
$args = array(
|
428 |
+
'id' => 'css_hover',
|
429 |
+
'css_id' => $element_index.'_css_hover',
|
430 |
+
'parent' => $input_name.'[wpjobmanager_company_name]',
|
431 |
+
'title' => __('Hover CSS','post-grid'),
|
432 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
433 |
+
'type' => 'textarea',
|
434 |
+
'value' => $css_hover,
|
435 |
+
'default' => '',
|
436 |
+
'placeholder' => '',
|
437 |
+
);
|
438 |
+
|
439 |
+
$settings_tabs_field->generate_field($args);
|
440 |
+
|
441 |
+
|
442 |
+
ob_start();
|
443 |
+
?>
|
444 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
445 |
+
<?php
|
446 |
+
|
447 |
+
$html = ob_get_clean();
|
448 |
+
|
449 |
+
$args = array(
|
450 |
+
'id' => 'use_css',
|
451 |
+
'title' => __('Use of CSS','post-grid'),
|
452 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
453 |
+
'type' => 'custom_html',
|
454 |
+
'html' => $html,
|
455 |
+
|
456 |
+
);
|
457 |
+
|
458 |
+
$settings_tabs_field->generate_field($args);
|
459 |
+
|
460 |
+
?>
|
461 |
+
|
462 |
+
</div>
|
463 |
+
</div>
|
464 |
+
<?php
|
465 |
+
|
466 |
+
}
|
467 |
+
|
468 |
+
|
469 |
+
|
470 |
+
add_action('post_grid_layout_element_wpjobmanager_company_name', 'post_grid_layout_element_wpjobmanager_company_name');
|
471 |
+
function post_grid_layout_element_wpjobmanager_company_name($args){
|
472 |
+
|
473 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
474 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
475 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
476 |
+
|
477 |
+
if(empty($post_id)) return;
|
478 |
+
|
479 |
+
$title = get_the_title($post_id);
|
480 |
+
|
481 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
482 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
483 |
+
|
484 |
+
|
485 |
+
|
486 |
+
//var_dump($wck_key);
|
487 |
+
|
488 |
+
$meta_value = get_post_meta($post_id, '_company_name', true );
|
489 |
+
|
490 |
+
if(!empty($meta_value)):
|
491 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
492 |
+
|
493 |
+
?>
|
494 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wpjobmanager_company_name ">
|
495 |
+
<?php echo ($meta_value); ?>
|
496 |
+
</div>
|
497 |
+
<?php
|
498 |
+
endif;
|
499 |
+
|
500 |
+
}
|
501 |
+
|
502 |
+
|
503 |
+
|
504 |
+
add_action('post_grid_layout_element_css_wpjobmanager_company_name', 'post_grid_layout_element_css_wpjobmanager_company_name', 10);
|
505 |
+
function post_grid_layout_element_css_wpjobmanager_company_name($args){
|
506 |
+
|
507 |
+
|
508 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
509 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
510 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
511 |
+
|
512 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
513 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
514 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
515 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
516 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
517 |
+
|
518 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
519 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
520 |
+
|
521 |
+
?>
|
522 |
+
<style type="text/css">
|
523 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
524 |
+
<?php if(!empty($color)): ?>
|
525 |
+
color: <?php echo $color; ?>;
|
526 |
+
<?php endif; ?>
|
527 |
+
<?php if(!empty($font_size)): ?>
|
528 |
+
font-size: <?php echo $font_size; ?>;
|
529 |
+
<?php endif; ?>
|
530 |
+
<?php if(!empty($font_family)): ?>
|
531 |
+
font-family: <?php echo $font_family; ?>;
|
532 |
+
<?php endif; ?>
|
533 |
+
<?php if(!empty($margin)): ?>
|
534 |
+
margin: <?php echo $margin; ?>;
|
535 |
+
<?php endif; ?>
|
536 |
+
<?php if(!empty($text_align)): ?>
|
537 |
+
text-align: <?php echo $text_align; ?>;
|
538 |
+
<?php endif; ?>
|
539 |
+
<?php if(!empty($css)): ?>
|
540 |
+
<?php echo $css; ?>
|
541 |
+
<?php endif; ?>
|
542 |
+
}
|
543 |
+
<?php if(!empty($css_hover)): ?>
|
544 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
545 |
+
<?php echo $css_hover; ?>
|
546 |
+
}
|
547 |
+
<?php endif; ?>
|
548 |
+
</style>
|
549 |
+
<?php
|
550 |
+
}
|
551 |
+
|
552 |
+
add_action('post_grid_layout_element_option_wpjobmanager_company_website','post_grid_layout_element_option_wpjobmanager_company_website');
|
553 |
+
function post_grid_layout_element_option_wpjobmanager_company_website($parameters){
|
554 |
+
|
555 |
+
$settings_tabs_field = new settings_tabs_field();
|
556 |
+
|
557 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
558 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
559 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
560 |
+
|
561 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
562 |
+
|
563 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
564 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
565 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
566 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
567 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
568 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
569 |
+
|
570 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
571 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
572 |
+
|
573 |
+
|
574 |
+
|
575 |
+
?>
|
576 |
+
<div class="item">
|
577 |
+
<div class="element-title header ">
|
578 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
579 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
580 |
+
|
581 |
+
<span class="expand"><?php echo __('Company website','post-grid'); ?></span>
|
582 |
+
</div>
|
583 |
+
<div class="element-options options">
|
584 |
+
|
585 |
+
<?php
|
586 |
+
|
587 |
+
|
588 |
+
$args = array(
|
589 |
+
'id' => 'wrapper_html',
|
590 |
+
'css_id' => $element_index.'_wrapper_html',
|
591 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
592 |
+
'title' => __('Wrapper html','post-grid'),
|
593 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output. ex: <code>Website: <a href="%s">Go link</a></code> <code>Website: <a href="%1$s">%2$s</a></code>','post-grid'),
|
594 |
+
'type' => 'text',
|
595 |
+
'value' => $wrapper_html,
|
596 |
+
'default' => '',
|
597 |
+
'placeholder' => 'Website: %s',
|
598 |
+
);
|
599 |
+
|
600 |
+
$settings_tabs_field->generate_field($args);
|
601 |
+
|
602 |
+
$args = array(
|
603 |
+
'id' => 'color',
|
604 |
+
'css_id' => $element_index.'_wpjobmanager_company_website',
|
605 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
606 |
+
'title' => __('Color','post-grid'),
|
607 |
+
'details' => __('Title text color.','post-grid'),
|
608 |
+
'type' => 'colorpicker',
|
609 |
+
'value' => $color,
|
610 |
+
'default' => '',
|
611 |
+
);
|
612 |
+
|
613 |
+
$settings_tabs_field->generate_field($args);
|
614 |
+
|
615 |
+
$args = array(
|
616 |
+
'id' => 'font_size',
|
617 |
+
'css_id' => $element_index.'_font_size',
|
618 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
619 |
+
'title' => __('Font size','post-grid'),
|
620 |
+
'details' => __('Set font size.','post-grid'),
|
621 |
+
'type' => 'text',
|
622 |
+
'value' => $font_size,
|
623 |
+
'default' => '',
|
624 |
+
'placeholder' => '14px',
|
625 |
+
);
|
626 |
+
|
627 |
+
$settings_tabs_field->generate_field($args);
|
628 |
+
|
629 |
+
|
630 |
+
$args = array(
|
631 |
+
'id' => 'font_family',
|
632 |
+
'css_id' => $element_index.'_font_family',
|
633 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
634 |
+
'title' => __('Font family','post-grid'),
|
635 |
+
'details' => __('Set font family.','post-grid'),
|
636 |
+
'type' => 'text',
|
637 |
+
'value' => $font_family,
|
638 |
+
'default' => '',
|
639 |
+
'placeholder' => 'Open Sans',
|
640 |
+
);
|
641 |
+
|
642 |
+
$settings_tabs_field->generate_field($args);
|
643 |
+
|
644 |
+
|
645 |
+
$args = array(
|
646 |
+
'id' => 'margin',
|
647 |
+
'css_id' => $element_index.'_margin',
|
648 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
649 |
+
'title' => __('Margin','post-grid'),
|
650 |
+
'details' => __('Set margin.','post-grid'),
|
651 |
+
'type' => 'text',
|
652 |
+
'value' => $margin,
|
653 |
+
'default' => '',
|
654 |
+
'placeholder' => '5px 0',
|
655 |
+
);
|
656 |
+
|
657 |
+
$settings_tabs_field->generate_field($args);
|
658 |
+
|
659 |
+
|
660 |
+
$args = array(
|
661 |
+
'id' => 'text_align',
|
662 |
+
'css_id' => $element_index.'_text_align',
|
663 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
664 |
+
'title' => __('Text align','post-grid'),
|
665 |
+
'details' => __('Choose text align.','post-grid'),
|
666 |
+
'type' => 'select',
|
667 |
+
'value' => $text_align,
|
668 |
+
'default' => 'left',
|
669 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
670 |
+
);
|
671 |
+
|
672 |
+
$settings_tabs_field->generate_field($args);
|
673 |
+
|
674 |
+
|
675 |
+
$args = array(
|
676 |
+
'id' => 'css',
|
677 |
+
'css_id' => $element_index.'_css',
|
678 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
679 |
+
'title' => __('Custom CSS','post-grid'),
|
680 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
681 |
+
'type' => 'textarea',
|
682 |
+
'value' => $css,
|
683 |
+
'default' => '',
|
684 |
+
'placeholder' => '',
|
685 |
+
);
|
686 |
+
|
687 |
+
$settings_tabs_field->generate_field($args);
|
688 |
+
|
689 |
+
$args = array(
|
690 |
+
'id' => 'css_hover',
|
691 |
+
'css_id' => $element_index.'_css_hover',
|
692 |
+
'parent' => $input_name.'[wpjobmanager_company_website]',
|
693 |
+
'title' => __('Hover CSS','post-grid'),
|
694 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
695 |
+
'type' => 'textarea',
|
696 |
+
'value' => $css_hover,
|
697 |
+
'default' => '',
|
698 |
+
'placeholder' => '',
|
699 |
+
);
|
700 |
+
|
701 |
+
$settings_tabs_field->generate_field($args);
|
702 |
+
|
703 |
+
|
704 |
+
ob_start();
|
705 |
+
?>
|
706 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
707 |
+
<?php
|
708 |
+
|
709 |
+
$html = ob_get_clean();
|
710 |
+
|
711 |
+
$args = array(
|
712 |
+
'id' => 'use_css',
|
713 |
+
'title' => __('Use of CSS','post-grid'),
|
714 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
715 |
+
'type' => 'custom_html',
|
716 |
+
'html' => $html,
|
717 |
+
|
718 |
+
);
|
719 |
+
|
720 |
+
$settings_tabs_field->generate_field($args);
|
721 |
+
|
722 |
+
?>
|
723 |
+
|
724 |
+
</div>
|
725 |
+
</div>
|
726 |
+
<?php
|
727 |
+
|
728 |
+
}
|
729 |
+
|
730 |
+
|
731 |
+
|
732 |
+
add_action('post_grid_layout_element_wpjobmanager_company_website', 'post_grid_layout_element_wpjobmanager_company_website');
|
733 |
+
function post_grid_layout_element_wpjobmanager_company_website($args){
|
734 |
+
|
735 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
736 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
737 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
738 |
+
|
739 |
+
if(empty($post_id)) return;
|
740 |
+
|
741 |
+
$title = get_the_title($post_id);
|
742 |
+
|
743 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
744 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
745 |
+
|
746 |
+
|
747 |
+
|
748 |
+
//var_dump($wck_key);
|
749 |
+
|
750 |
+
$meta_value = get_post_meta($post_id, '_company_website', true );
|
751 |
+
|
752 |
+
if(!empty($meta_value)):
|
753 |
+
$meta_value = sprintf($wrapper_html, $meta_value, $meta_value);
|
754 |
+
|
755 |
+
?>
|
756 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wpjobmanager_company_website ">
|
757 |
+
<?php echo ($meta_value); ?>
|
758 |
+
</div>
|
759 |
+
<?php
|
760 |
+
endif;
|
761 |
+
|
762 |
+
}
|
763 |
+
|
764 |
+
|
765 |
+
|
766 |
+
add_action('post_grid_layout_element_css_wpjobmanager_company_website', 'post_grid_layout_element_css_wpjobmanager_company_website', 10);
|
767 |
+
function post_grid_layout_element_css_wpjobmanager_company_website($args){
|
768 |
+
|
769 |
+
|
770 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
771 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
772 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
773 |
+
|
774 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
775 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
776 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
777 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
778 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
779 |
+
|
780 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
781 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
782 |
+
|
783 |
+
?>
|
784 |
+
<style type="text/css">
|
785 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
786 |
+
<?php if(!empty($color)): ?>
|
787 |
+
color: <?php echo $color; ?>;
|
788 |
+
<?php endif; ?>
|
789 |
+
<?php if(!empty($font_size)): ?>
|
790 |
+
font-size: <?php echo $font_size; ?>;
|
791 |
+
<?php endif; ?>
|
792 |
+
<?php if(!empty($font_family)): ?>
|
793 |
+
font-family: <?php echo $font_family; ?>;
|
794 |
+
<?php endif; ?>
|
795 |
+
<?php if(!empty($margin)): ?>
|
796 |
+
margin: <?php echo $margin; ?>;
|
797 |
+
<?php endif; ?>
|
798 |
+
<?php if(!empty($text_align)): ?>
|
799 |
+
text-align: <?php echo $text_align; ?>;
|
800 |
+
<?php endif; ?>
|
801 |
+
<?php if(!empty($css)): ?>
|
802 |
+
<?php echo $css; ?>
|
803 |
+
<?php endif; ?>
|
804 |
+
}
|
805 |
+
<?php if(!empty($css_hover)): ?>
|
806 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
807 |
+
<?php echo $css_hover; ?>
|
808 |
+
}
|
809 |
+
<?php endif; ?>
|
810 |
+
</style>
|
811 |
+
<?php
|
812 |
+
}
|
813 |
+
|
814 |
+
|
815 |
+
add_action('post_grid_layout_element_option_wpjobmanager_company_tagline','post_grid_layout_element_option_wpjobmanager_company_tagline');
|
816 |
+
function post_grid_layout_element_option_wpjobmanager_company_tagline($parameters){
|
817 |
+
|
818 |
+
$settings_tabs_field = new settings_tabs_field();
|
819 |
+
|
820 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
821 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
822 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
823 |
+
|
824 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
825 |
+
|
826 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
827 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
828 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
829 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
830 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
831 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
832 |
+
|
833 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
834 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
835 |
+
|
836 |
+
|
837 |
+
|
838 |
+
?>
|
839 |
+
<div class="item">
|
840 |
+
<div class="element-title header ">
|
841 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
842 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
843 |
+
|
844 |
+
<span class="expand"><?php echo __('Company tagline','post-grid'); ?></span>
|
845 |
+
</div>
|
846 |
+
<div class="element-options options">
|
847 |
+
|
848 |
+
<?php
|
849 |
+
|
850 |
+
|
851 |
+
$args = array(
|
852 |
+
'id' => 'wrapper_html',
|
853 |
+
'css_id' => $element_index.'_wrapper_html',
|
854 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
855 |
+
'title' => __('Wrapper html','post-grid'),
|
856 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output.','post-grid'),
|
857 |
+
'type' => 'text',
|
858 |
+
'value' => $wrapper_html,
|
859 |
+
'default' => '',
|
860 |
+
'placeholder' => 'Tagline: %s',
|
861 |
+
);
|
862 |
+
|
863 |
+
$settings_tabs_field->generate_field($args);
|
864 |
+
|
865 |
+
$args = array(
|
866 |
+
'id' => 'color',
|
867 |
+
'css_id' => $element_index.'_wpjobmanager_company_tagline',
|
868 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
869 |
+
'title' => __('Color','post-grid'),
|
870 |
+
'details' => __('Title text color.','post-grid'),
|
871 |
+
'type' => 'colorpicker',
|
872 |
+
'value' => $color,
|
873 |
+
'default' => '',
|
874 |
+
);
|
875 |
+
|
876 |
+
$settings_tabs_field->generate_field($args);
|
877 |
+
|
878 |
+
$args = array(
|
879 |
+
'id' => 'font_size',
|
880 |
+
'css_id' => $element_index.'_font_size',
|
881 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
882 |
+
'title' => __('Font size','post-grid'),
|
883 |
+
'details' => __('Set font size.','post-grid'),
|
884 |
+
'type' => 'text',
|
885 |
+
'value' => $font_size,
|
886 |
+
'default' => '',
|
887 |
+
'placeholder' => '14px',
|
888 |
+
);
|
889 |
+
|
890 |
+
$settings_tabs_field->generate_field($args);
|
891 |
+
|
892 |
+
|
893 |
+
$args = array(
|
894 |
+
'id' => 'font_family',
|
895 |
+
'css_id' => $element_index.'_font_family',
|
896 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
897 |
+
'title' => __('Font family','post-grid'),
|
898 |
+
'details' => __('Set font family.','post-grid'),
|
899 |
+
'type' => 'text',
|
900 |
+
'value' => $font_family,
|
901 |
+
'default' => '',
|
902 |
+
'placeholder' => 'Open Sans',
|
903 |
+
);
|
904 |
+
|
905 |
+
$settings_tabs_field->generate_field($args);
|
906 |
+
|
907 |
+
|
908 |
+
$args = array(
|
909 |
+
'id' => 'margin',
|
910 |
+
'css_id' => $element_index.'_margin',
|
911 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
912 |
+
'title' => __('Margin','post-grid'),
|
913 |
+
'details' => __('Set margin.','post-grid'),
|
914 |
+
'type' => 'text',
|
915 |
+
'value' => $margin,
|
916 |
+
'default' => '',
|
917 |
+
'placeholder' => '5px 0',
|
918 |
+
);
|
919 |
+
|
920 |
+
$settings_tabs_field->generate_field($args);
|
921 |
+
|
922 |
+
|
923 |
+
$args = array(
|
924 |
+
'id' => 'text_align',
|
925 |
+
'css_id' => $element_index.'_text_align',
|
926 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
927 |
+
'title' => __('Text align','post-grid'),
|
928 |
+
'details' => __('Choose text align.','post-grid'),
|
929 |
+
'type' => 'select',
|
930 |
+
'value' => $text_align,
|
931 |
+
'default' => 'left',
|
932 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
933 |
+
);
|
934 |
+
|
935 |
+
$settings_tabs_field->generate_field($args);
|
936 |
+
|
937 |
+
|
938 |
+
$args = array(
|
939 |
+
'id' => 'css',
|
940 |
+
'css_id' => $element_index.'_css',
|
941 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
942 |
+
'title' => __('Custom CSS','post-grid'),
|
943 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
944 |
+
'type' => 'textarea',
|
945 |
+
'value' => $css,
|
946 |
+
'default' => '',
|
947 |
+
'placeholder' => '',
|
948 |
+
);
|
949 |
+
|
950 |
+
$settings_tabs_field->generate_field($args);
|
951 |
+
|
952 |
+
$args = array(
|
953 |
+
'id' => 'css_hover',
|
954 |
+
'css_id' => $element_index.'_css_hover',
|
955 |
+
'parent' => $input_name.'[wpjobmanager_company_tagline]',
|
956 |
+
'title' => __('Hover CSS','post-grid'),
|
957 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
958 |
+
'type' => 'textarea',
|
959 |
+
'value' => $css_hover,
|
960 |
+
'default' => '',
|
961 |
+
'placeholder' => '',
|
962 |
+
);
|
963 |
+
|
964 |
+
$settings_tabs_field->generate_field($args);
|
965 |
+
|
966 |
+
|
967 |
+
ob_start();
|
968 |
+
?>
|
969 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
970 |
+
<?php
|
971 |
+
|
972 |
+
$html = ob_get_clean();
|
973 |
+
|
974 |
+
$args = array(
|
975 |
+
'id' => 'use_css',
|
976 |
+
'title' => __('Use of CSS','post-grid'),
|
977 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
978 |
+
'type' => 'custom_html',
|
979 |
+
'html' => $html,
|
980 |
+
|
981 |
+
);
|
982 |
+
|
983 |
+
$settings_tabs_field->generate_field($args);
|
984 |
+
|
985 |
+
?>
|
986 |
+
|
987 |
+
</div>
|
988 |
+
</div>
|
989 |
+
<?php
|
990 |
+
|
991 |
+
}
|
992 |
+
|
993 |
+
|
994 |
+
|
995 |
+
add_action('post_grid_layout_element_wpjobmanager_company_tagline', 'post_grid_layout_element_wpjobmanager_company_tagline');
|
996 |
+
function post_grid_layout_element_wpjobmanager_company_tagline($args){
|
997 |
+
|
998 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
999 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1000 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1001 |
+
|
1002 |
+
if(empty($post_id)) return;
|
1003 |
+
|
1004 |
+
$title = get_the_title($post_id);
|
1005 |
+
|
1006 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1007 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1008 |
+
|
1009 |
+
|
1010 |
+
|
1011 |
+
//var_dump($wck_key);
|
1012 |
+
|
1013 |
+
$meta_value = get_post_meta($post_id, '_company_tagline', true );
|
1014 |
+
|
1015 |
+
if(!empty($meta_value)):
|
1016 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
1017 |
+
|
1018 |
+
?>
|
1019 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wpjobmanager_company_tagline ">
|
1020 |
+
<?php echo ($meta_value); ?>
|
1021 |
+
</div>
|
1022 |
+
<?php
|
1023 |
+
endif;
|
1024 |
+
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
|
1028 |
+
|
1029 |
+
add_action('post_grid_layout_element_css_wpjobmanager_company_tagline', 'post_grid_layout_element_css_wpjobmanager_company_tagline', 10);
|
1030 |
+
function post_grid_layout_element_css_wpjobmanager_company_tagline($args){
|
1031 |
+
|
1032 |
+
|
1033 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1034 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1035 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1036 |
+
|
1037 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1038 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1039 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1040 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1041 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1042 |
+
|
1043 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1044 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1045 |
+
|
1046 |
+
?>
|
1047 |
+
<style type="text/css">
|
1048 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1049 |
+
<?php if(!empty($color)): ?>
|
1050 |
+
color: <?php echo $color; ?>;
|
1051 |
+
<?php endif; ?>
|
1052 |
+
<?php if(!empty($font_size)): ?>
|
1053 |
+
font-size: <?php echo $font_size; ?>;
|
1054 |
+
<?php endif; ?>
|
1055 |
+
<?php if(!empty($font_family)): ?>
|
1056 |
+
font-family: <?php echo $font_family; ?>;
|
1057 |
+
<?php endif; ?>
|
1058 |
+
<?php if(!empty($margin)): ?>
|
1059 |
+
margin: <?php echo $margin; ?>;
|
1060 |
+
<?php endif; ?>
|
1061 |
+
<?php if(!empty($text_align)): ?>
|
1062 |
+
text-align: <?php echo $text_align; ?>;
|
1063 |
+
<?php endif; ?>
|
1064 |
+
<?php if(!empty($css)): ?>
|
1065 |
+
<?php echo $css; ?>
|
1066 |
+
<?php endif; ?>
|
1067 |
+
}
|
1068 |
+
<?php if(!empty($css_hover)): ?>
|
1069 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1070 |
+
<?php echo $css_hover; ?>
|
1071 |
+
}
|
1072 |
+
<?php endif; ?>
|
1073 |
+
</style>
|
1074 |
+
<?php
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
|
1078 |
+
add_action('post_grid_layout_element_option_wpjobmanager_job_expires','post_grid_layout_element_option_wpjobmanager_job_expires');
|
1079 |
+
function post_grid_layout_element_option_wpjobmanager_job_expires($parameters){
|
1080 |
+
|
1081 |
+
$settings_tabs_field = new settings_tabs_field();
|
1082 |
+
|
1083 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
1084 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
1085 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
1086 |
+
|
1087 |
+
$wck_key = isset($element_data['wck_key']) ? $element_data['wck_key'] : '';
|
1088 |
+
|
1089 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
1090 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
1091 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
1092 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
1093 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
1094 |
+
$wrapper_html = !empty($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
|
1095 |
+
|
1096 |
+
$css = isset($element_data['css']) ? $element_data['css'] : '';
|
1097 |
+
$css_hover = isset($element_data['css_hover']) ? $element_data['css_hover'] : '';
|
1098 |
+
|
1099 |
+
|
1100 |
+
|
1101 |
+
?>
|
1102 |
+
<div class="item">
|
1103 |
+
<div class="element-title header ">
|
1104 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
1105 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
1106 |
+
|
1107 |
+
<span class="expand"><?php echo __('Job expire date','post-grid'); ?></span>
|
1108 |
+
</div>
|
1109 |
+
<div class="element-options options">
|
1110 |
+
|
1111 |
+
<?php
|
1112 |
+
|
1113 |
+
|
1114 |
+
$args = array(
|
1115 |
+
'id' => 'wrapper_html',
|
1116 |
+
'css_id' => $element_index.'_wrapper_html',
|
1117 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1118 |
+
'title' => __('Wrapper html','post-grid'),
|
1119 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace output.','post-grid'),
|
1120 |
+
'type' => 'text',
|
1121 |
+
'value' => $wrapper_html,
|
1122 |
+
'default' => '',
|
1123 |
+
'placeholder' => 'Expire date: %s',
|
1124 |
+
);
|
1125 |
+
|
1126 |
+
$settings_tabs_field->generate_field($args);
|
1127 |
+
|
1128 |
+
$args = array(
|
1129 |
+
'id' => 'color',
|
1130 |
+
'css_id' => $element_index.'_wpjobmanager_job_expires',
|
1131 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1132 |
+
'title' => __('Color','post-grid'),
|
1133 |
+
'details' => __('Title text color.','post-grid'),
|
1134 |
+
'type' => 'colorpicker',
|
1135 |
+
'value' => $color,
|
1136 |
+
'default' => '',
|
1137 |
+
);
|
1138 |
+
|
1139 |
+
$settings_tabs_field->generate_field($args);
|
1140 |
+
|
1141 |
+
$args = array(
|
1142 |
+
'id' => 'font_size',
|
1143 |
+
'css_id' => $element_index.'_font_size',
|
1144 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1145 |
+
'title' => __('Font size','post-grid'),
|
1146 |
+
'details' => __('Set font size.','post-grid'),
|
1147 |
+
'type' => 'text',
|
1148 |
+
'value' => $font_size,
|
1149 |
+
'default' => '',
|
1150 |
+
'placeholder' => '14px',
|
1151 |
+
);
|
1152 |
+
|
1153 |
+
$settings_tabs_field->generate_field($args);
|
1154 |
+
|
1155 |
+
|
1156 |
+
$args = array(
|
1157 |
+
'id' => 'font_family',
|
1158 |
+
'css_id' => $element_index.'_font_family',
|
1159 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1160 |
+
'title' => __('Font family','post-grid'),
|
1161 |
+
'details' => __('Set font family.','post-grid'),
|
1162 |
+
'type' => 'text',
|
1163 |
+
'value' => $font_family,
|
1164 |
+
'default' => '',
|
1165 |
+
'placeholder' => 'Open Sans',
|
1166 |
+
);
|
1167 |
+
|
1168 |
+
$settings_tabs_field->generate_field($args);
|
1169 |
+
|
1170 |
+
|
1171 |
+
$args = array(
|
1172 |
+
'id' => 'margin',
|
1173 |
+
'css_id' => $element_index.'_margin',
|
1174 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1175 |
+
'title' => __('Margin','post-grid'),
|
1176 |
+
'details' => __('Set margin.','post-grid'),
|
1177 |
+
'type' => 'text',
|
1178 |
+
'value' => $margin,
|
1179 |
+
'default' => '',
|
1180 |
+
'placeholder' => '5px 0',
|
1181 |
+
);
|
1182 |
+
|
1183 |
+
$settings_tabs_field->generate_field($args);
|
1184 |
+
|
1185 |
+
|
1186 |
+
$args = array(
|
1187 |
+
'id' => 'text_align',
|
1188 |
+
'css_id' => $element_index.'_text_align',
|
1189 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1190 |
+
'title' => __('Text align','post-grid'),
|
1191 |
+
'details' => __('Choose text align.','post-grid'),
|
1192 |
+
'type' => 'select',
|
1193 |
+
'value' => $text_align,
|
1194 |
+
'default' => 'left',
|
1195 |
+
'args' => array('left'=> __('Left', 'post-grid'),'right'=> __('Right', 'post-grid'),'center'=> __('Center', 'post-grid') ),
|
1196 |
+
);
|
1197 |
+
|
1198 |
+
$settings_tabs_field->generate_field($args);
|
1199 |
+
|
1200 |
+
|
1201 |
+
$args = array(
|
1202 |
+
'id' => 'css',
|
1203 |
+
'css_id' => $element_index.'_css',
|
1204 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1205 |
+
'title' => __('Custom CSS','post-grid'),
|
1206 |
+
'details' => __('Set csutom CSS.','post-grid'),
|
1207 |
+
'type' => 'textarea',
|
1208 |
+
'value' => $css,
|
1209 |
+
'default' => '',
|
1210 |
+
'placeholder' => '',
|
1211 |
+
);
|
1212 |
+
|
1213 |
+
$settings_tabs_field->generate_field($args);
|
1214 |
+
|
1215 |
+
$args = array(
|
1216 |
+
'id' => 'css_hover',
|
1217 |
+
'css_id' => $element_index.'_css_hover',
|
1218 |
+
'parent' => $input_name.'[wpjobmanager_job_expires]',
|
1219 |
+
'title' => __('Hover CSS','post-grid'),
|
1220 |
+
'details' => __('Set hover custom CSS.','post-grid'),
|
1221 |
+
'type' => 'textarea',
|
1222 |
+
'value' => $css_hover,
|
1223 |
+
'default' => '',
|
1224 |
+
'placeholder' => '',
|
1225 |
+
);
|
1226 |
+
|
1227 |
+
$settings_tabs_field->generate_field($args);
|
1228 |
+
|
1229 |
+
|
1230 |
+
ob_start();
|
1231 |
+
?>
|
1232 |
+
<textarea readonly type="text" onclick="this.select();">.element_<?php echo $element_index?>{}</textarea>
|
1233 |
+
<?php
|
1234 |
+
|
1235 |
+
$html = ob_get_clean();
|
1236 |
+
|
1237 |
+
$args = array(
|
1238 |
+
'id' => 'use_css',
|
1239 |
+
'title' => __('Use of CSS','post-grid'),
|
1240 |
+
'details' => __('Use following class selector to add custom CSS for this element.','post-grid'),
|
1241 |
+
'type' => 'custom_html',
|
1242 |
+
'html' => $html,
|
1243 |
+
|
1244 |
+
);
|
1245 |
+
|
1246 |
+
$settings_tabs_field->generate_field($args);
|
1247 |
+
|
1248 |
+
?>
|
1249 |
+
|
1250 |
+
</div>
|
1251 |
+
</div>
|
1252 |
+
<?php
|
1253 |
+
|
1254 |
+
}
|
1255 |
+
|
1256 |
+
|
1257 |
+
|
1258 |
+
add_action('post_grid_layout_element_wpjobmanager_job_expires', 'post_grid_layout_element_wpjobmanager_job_expires');
|
1259 |
+
function post_grid_layout_element_wpjobmanager_job_expires($args){
|
1260 |
+
|
1261 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1262 |
+
$elementIndex = isset($args['index']) ? $args['index'] : '';
|
1263 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
1264 |
+
|
1265 |
+
if(empty($post_id)) return;
|
1266 |
+
|
1267 |
+
$title = get_the_title($post_id);
|
1268 |
+
|
1269 |
+
$custom_class = isset($element['custom_class']) ? $element['custom_class'] : '';
|
1270 |
+
$wrapper_html = isset($element['wrapper_html']) ? $element['wrapper_html'] : '%s';
|
1271 |
+
|
1272 |
+
|
1273 |
+
|
1274 |
+
//var_dump($wck_key);
|
1275 |
+
|
1276 |
+
$meta_value = get_post_meta($post_id, '_job_expires', true );
|
1277 |
+
|
1278 |
+
//var_dump($meta_value);
|
1279 |
+
|
1280 |
+
if(!empty($meta_value)):
|
1281 |
+
$meta_value = sprintf($wrapper_html, $meta_value);
|
1282 |
+
|
1283 |
+
?>
|
1284 |
+
<div class="element element_<?php echo esc_attr($elementIndex); ?> <?php echo esc_attr($custom_class); ?> wpjobmanager_job_expires ">
|
1285 |
+
<?php echo ($meta_value); ?>
|
1286 |
+
</div>
|
1287 |
+
<?php
|
1288 |
+
endif;
|
1289 |
+
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
|
1293 |
+
|
1294 |
+
add_action('post_grid_layout_element_css_wpjobmanager_job_expires', 'post_grid_layout_element_css_wpjobmanager_job_expires', 10);
|
1295 |
+
function post_grid_layout_element_css_wpjobmanager_job_expires($args){
|
1296 |
+
|
1297 |
+
|
1298 |
+
$index = isset($args['index']) ? $args['index'] : '';
|
1299 |
+
$element = isset($args['element']) ? $args['element'] : array();
|
1300 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1301 |
+
|
1302 |
+
$color = isset($element['color']) ? $element['color'] : '';
|
1303 |
+
$font_size = isset($element['font_size']) ? $element['font_size'] : '';
|
1304 |
+
$font_family = isset($element['font_family']) ? $element['font_family'] : '';
|
1305 |
+
$margin = isset($element['margin']) ? $element['margin'] : '';
|
1306 |
+
$text_align = isset($element['text_align']) ? $element['text_align'] : 'left';
|
1307 |
+
|
1308 |
+
$css = isset($element['css']) ? $element['css'] : '';
|
1309 |
+
$css_hover = isset($element['css_hover']) ? $element['css_hover'] : '';
|
1310 |
+
|
1311 |
+
?>
|
1312 |
+
<style type="text/css">
|
1313 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>{
|
1314 |
+
<?php if(!empty($color)): ?>
|
1315 |
+
color: <?php echo $color; ?>;
|
1316 |
+
<?php endif; ?>
|
1317 |
+
<?php if(!empty($font_size)): ?>
|
1318 |
+
font-size: <?php echo $font_size; ?>;
|
1319 |
+
<?php endif; ?>
|
1320 |
+
<?php if(!empty($font_family)): ?>
|
1321 |
+
font-family: <?php echo $font_family; ?>;
|
1322 |
+
<?php endif; ?>
|
1323 |
+
<?php if(!empty($margin)): ?>
|
1324 |
+
margin: <?php echo $margin; ?>;
|
1325 |
+
<?php endif; ?>
|
1326 |
+
<?php if(!empty($text_align)): ?>
|
1327 |
+
text-align: <?php echo $text_align; ?>;
|
1328 |
+
<?php endif; ?>
|
1329 |
+
<?php if(!empty($css)): ?>
|
1330 |
+
<?php echo $css; ?>
|
1331 |
+
<?php endif; ?>
|
1332 |
+
}
|
1333 |
+
<?php if(!empty($css_hover)): ?>
|
1334 |
+
.layout-<?php echo $layout_id; ?> .element_<?php echo $index; ?>:hover{
|
1335 |
+
<?php echo $css_hover; ?>
|
1336 |
+
}
|
1337 |
+
<?php endif; ?>
|
1338 |
+
</style>
|
1339 |
+
<?php
|
1340 |
+
}
|
includes/menu/addons.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
wp_enqueue_style( 'post-grid-addons' );
|
5 |
+
|
6 |
+
|
7 |
+
$class_post_grid_functions = new class_post_grid_functions();
|
8 |
+
$addons_list = $class_post_grid_functions->addons_list();
|
9 |
+
|
10 |
+
?>
|
11 |
+
<div class="wrap">
|
12 |
+
<div id="icon-tools" class="icon32"><br></div><h2><?php echo sprintf(__('%s - Extensions', 'post-grid'), post_grid_plugin_name)?></h2>
|
13 |
+
|
14 |
+
|
15 |
+
<div class="addon-list">
|
16 |
+
|
17 |
+
<?php
|
18 |
+
|
19 |
+
if(!empty($addons_list)):
|
20 |
+
foreach ($addons_list as $addon):
|
21 |
+
$addon_title = isset($addon['title']) ? $addon['title'] : '';
|
22 |
+
$item_link = isset($addon['item_link']) ? $addon['item_link'] : '';
|
23 |
+
$addon_thumb = isset($addon['thumb']) ? $addon['thumb'] : '';
|
24 |
+
$zip_link = isset($addon['zip_link']) ? $addon['zip_link'] : '';
|
25 |
+
$wp_org_slug = isset($addon['wp_org_slug']) ? $addon['wp_org_slug'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
?>
|
29 |
+
<div class="item">
|
30 |
+
<div class="thumb-wrap">
|
31 |
+
<a href="<?php echo $item_link;?>"><img src="<?php echo $addon_thumb;?>"></a>
|
32 |
+
</div>
|
33 |
+
<div class="addon-title"><a class="addon-link" href="<?php echo $item_link;?>"><?php echo $addon_title;?></a></div>
|
34 |
+
<?php if(!empty($zip_link)): ?>
|
35 |
+
<div class="addon-link button"><a href="<?php echo $zip_link;?>">Download</a> </div>
|
36 |
+
<?php endif; ?>
|
37 |
+
|
38 |
+
|
39 |
+
</div>
|
40 |
+
<?php
|
41 |
+
endforeach;
|
42 |
+
endif;
|
43 |
+
|
44 |
+
?>
|
45 |
+
|
46 |
+
|
47 |
+
</div>
|
48 |
+
|
49 |
+
|
50 |
+
</div>
|
includes/menu/import-layouts.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
-
|
4 |
-
$post_grid_info = get_option('post_grid_info');
|
5 |
-
|
6 |
-
$import_layouts = isset($post_grid_info['import_layouts']) ? $post_grid_info['import_layouts'] : '';
|
7 |
-
|
8 |
-
?>
|
9 |
-
<div class="wrap">
|
10 |
-
<div id="icon-tools" class="icon32"><br></div><h2><?php echo sprintf(__('%s - Import layouts', 'post-grid'), post_grid_plugin_name)?></h2>
|
11 |
-
|
12 |
-
|
13 |
-
<form method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
|
14 |
-
<input type="hidden" name="post_grid_hidden" value="Y">
|
15 |
-
<?php
|
16 |
-
if(!empty($_POST['post_grid_hidden'])){
|
17 |
-
$nonce = sanitize_text_field($_POST['_wpnonce']);
|
18 |
-
if(wp_verify_nonce( $nonce, 'post_grid_nonce' ) && $_POST['post_grid_hidden'] == 'Y') {
|
19 |
-
|
20 |
-
$import_layouts = isset($_POST['import_layouts']) ? 'done' : '';
|
21 |
-
$post_grid_info['import_layouts'] = $import_layouts;
|
22 |
-
|
23 |
-
update_option('post_grid_info', $post_grid_info)
|
24 |
-
|
25 |
-
?>
|
26 |
-
<div class="updated notice is-dismissible"><p><strong><?php _e('Changes Saved.', 'post-grid' ); ?></strong></p></div>
|
27 |
-
<?php
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
|
32 |
-
if (is_plugin_active('post-grid-pro/post-grid-pro.php')){
|
33 |
-
$layouts_plugin_url = post_grid_pro_plugin_url;
|
34 |
-
}else{
|
35 |
-
$layouts_plugin_url = post_grid_plugin_url;
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
?>
|
41 |
-
|
42 |
-
<p><b>Post Gird</b> provide some ready layouts to get started, please follow the steps bellow to import default layouts.</p>
|
43 |
-
|
44 |
-
<ul>
|
45 |
-
<li>Step - 1: Go to <a href="<?php echo admin_url(); ?>import.php">import</a> menu and install & activate <b>WordPress</b> Importer plugin. click to "Install Now" button to install.</li>
|
46 |
-
<li>Step - 2: Download following xml file <a href="<?php echo $layouts_plugin_url; ?>sample-data/post-grid-layouts.xml">post-grid-layouts.xml</a>, save the file on your local machine.</li>
|
47 |
-
<li>Step - 3: Go to importer page <a href="<?php echo admin_url(); ?>import.php?import=wordpress">Import WordPress</a> and chose the downloaded file and then click to <b>Upload file and import</b>.</li>
|
48 |
-
<li>Step - 4: Go to <a href="<?php echo admin_url(); ?>edit.php?post_type=post_grid_layout">Post Grid layouts</a> page to see imported layouts.</li>
|
49 |
-
|
50 |
-
</ul>
|
51 |
-
|
52 |
-
|
53 |
-
<p><label><input type="checkbox" <?php if(!empty($import_layouts)) echo 'checked'; ?> name="import_layouts" value="1"> Mark as done</label></p>
|
54 |
-
|
55 |
-
|
56 |
-
<div class="clear clearfix"></div>
|
57 |
-
<p class="submit">
|
58 |
-
<?php wp_nonce_field( 'post_grid_nonce' ); ?>
|
59 |
-
<input class="button button-primary" type="submit" name="Submit" value="<?php _e('Save Changes','post-grid' ); ?>" />
|
60 |
-
</p>
|
61 |
-
|
62 |
-
|
63 |
-
</form>
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu/settings.php
CHANGED
@@ -29,7 +29,6 @@ $post_grid_settings_tab[] = array(
|
|
29 |
|
30 |
|
31 |
|
32 |
-
|
33 |
$post_grid_settings_tab[] = array(
|
34 |
'id' => 'buy_pro',
|
35 |
'title' => sprintf(__('%s Buy Pro','post-grid'),'<i class="fas fa-store"></i>'),
|
@@ -37,6 +36,12 @@ $post_grid_settings_tab[] = array(
|
|
37 |
'active' => ($current_tab == 'buy_pro') ? true : false,
|
38 |
);
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
$post_grid_settings_tab = apply_filters('post_grid_settings_tabs', $post_grid_settings_tab);
|
41 |
|
42 |
$tabs_sorted = array();
|
29 |
|
30 |
|
31 |
|
|
|
32 |
$post_grid_settings_tab[] = array(
|
33 |
'id' => 'buy_pro',
|
34 |
'title' => sprintf(__('%s Buy Pro','post-grid'),'<i class="fas fa-store"></i>'),
|
36 |
'active' => ($current_tab == 'buy_pro') ? true : false,
|
37 |
);
|
38 |
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
$post_grid_settings_tab = apply_filters('post_grid_settings_tabs', $post_grid_settings_tab);
|
46 |
|
47 |
$tabs_sorted = array();
|
includes/metabox-post-options-hook.php
CHANGED
@@ -7,8 +7,6 @@
|
|
7 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
8 |
|
9 |
|
10 |
-
|
11 |
-
|
12 |
add_action('post_grid_post_options_content_options', 'post_grid_post_options_content_options',10, 2);
|
13 |
|
14 |
function post_grid_post_options_content_options($tab, $post_id){
|
@@ -80,163 +78,3 @@ function post_grid_post_options_content_options($tab, $post_id){
|
|
80 |
|
81 |
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
add_action('post_grid_post_options_content_post_template', 'post_grid_post_options_content_post_template',10, 2);
|
86 |
-
|
87 |
-
function post_grid_post_options_content_post_template($tab, $post_id){
|
88 |
-
|
89 |
-
$settings_tabs_field = new settings_tabs_field();
|
90 |
-
|
91 |
-
$post_grid_post_settings = get_post_meta($post_id, 'post_grid_post_settings', true);
|
92 |
-
|
93 |
-
$remove_post_title = !empty($post_grid_post_settings['remove_post_title']) ? $post_grid_post_settings['remove_post_title'] : '';
|
94 |
-
$remove_post_thumbnail = !empty($post_grid_post_settings['remove_post_thumbnail']) ? $post_grid_post_settings['remove_post_thumbnail'] : '';
|
95 |
-
|
96 |
-
|
97 |
-
?>
|
98 |
-
<div class="section">
|
99 |
-
<div class="section-title">Post template</div>
|
100 |
-
<p class="description section-description">Customize post template settings, will applied to single post template for this post.</p>
|
101 |
-
|
102 |
-
|
103 |
-
<?php
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
$args = array(
|
108 |
-
'id' => 'remove_post_title',
|
109 |
-
'parent' => 'post_grid_post_settings',
|
110 |
-
'title' => __('Remove post title','post-grid'),
|
111 |
-
'details' => __('Remove default post title from single post template.','post-grid'),
|
112 |
-
'type' => 'radio',
|
113 |
-
'value' => $remove_post_title,
|
114 |
-
'default' => 'no',
|
115 |
-
'args' => array(
|
116 |
-
'yes'=>__('Yes','post-grid'),
|
117 |
-
'no'=>__('No','post-grid'),
|
118 |
-
),
|
119 |
-
);
|
120 |
-
|
121 |
-
$settings_tabs_field->generate_field($args, $post_id);
|
122 |
-
|
123 |
-
$args = array(
|
124 |
-
'id' => 'remove_post_thumbnail',
|
125 |
-
'parent' => 'post_grid_post_settings',
|
126 |
-
'title' => __('Remove post thumbnail','post-grid'),
|
127 |
-
'details' => __('Remove default post thumbnail from single post template.','post-grid'),
|
128 |
-
'type' => 'radio',
|
129 |
-
'value' => $remove_post_thumbnail,
|
130 |
-
'default' => 'no',
|
131 |
-
'args' => array(
|
132 |
-
'yes'=>__('Yes','post-grid'),
|
133 |
-
'no'=>__('No','post-grid'),
|
134 |
-
),
|
135 |
-
);
|
136 |
-
|
137 |
-
$settings_tabs_field->generate_field($args, $post_id);
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
?>
|
143 |
-
</div>
|
144 |
-
<?php
|
145 |
-
|
146 |
-
|
147 |
-
//var_dump($post_id);
|
148 |
-
$settings_tabs_field = new settings_tabs_field();
|
149 |
-
$post_grid_post_settings = get_post_meta($post_id,'post_grid_post_settings', true);
|
150 |
-
$layout_id = !empty($post_grid_post_settings['layout_id']) ? $post_grid_post_settings['layout_id'] : ''; //post_grid_get_first_post('post_grid_layout')
|
151 |
-
|
152 |
-
|
153 |
-
?>
|
154 |
-
<div class="section">
|
155 |
-
|
156 |
-
<?php
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
ob_start();
|
161 |
-
|
162 |
-
?>
|
163 |
-
<p><a target="_blank" class="button" href="<?php echo admin_url().'post-new.php?post_type=post_grid_layout'; ?>"><?php echo __('Create layout','post-grid'); ?></a> </p>
|
164 |
-
<p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=post_grid_layout'; ?>"><?php echo __('Manage layouts','post-grid'); ?></a> </p>
|
165 |
-
<?php
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
$html = ob_get_clean();
|
170 |
-
|
171 |
-
$args = array(
|
172 |
-
'id' => 'post_grid_layout_create',
|
173 |
-
//'parent' => 'post_grid_post_settings',
|
174 |
-
'title' => __('Create layout','post-grid'),
|
175 |
-
'details' => __('Please follow the links to create layouts or manage.','post-grid'),
|
176 |
-
'type' => 'custom_html',
|
177 |
-
'html' => $html,
|
178 |
-
);
|
179 |
-
|
180 |
-
$settings_tabs_field->generate_field($args);
|
181 |
-
|
182 |
-
|
183 |
-
$item_layout_args = array();
|
184 |
-
|
185 |
-
$query_args['post_type'] = array('post_grid_layout');
|
186 |
-
$query_args['post_status'] = array('publish');
|
187 |
-
$query_args['orderby'] = 'date';
|
188 |
-
$query_args['order'] = 'DESC';
|
189 |
-
$query_args['posts_per_page'] = -1;
|
190 |
-
$wp_query = new WP_Query($query_args);
|
191 |
-
|
192 |
-
$item_layout_args[''] = array('name'=>'Empty layout', 'thumb'=> 'https://i.imgur.com/JyurCtY.jpg', );
|
193 |
-
|
194 |
-
|
195 |
-
if ( $wp_query->have_posts() ) :
|
196 |
-
|
197 |
-
|
198 |
-
while ( $wp_query->have_posts() ) : $wp_query->the_post();
|
199 |
-
|
200 |
-
$post_id = get_the_id();
|
201 |
-
$layout_name = get_the_title();
|
202 |
-
$product_thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'full' );
|
203 |
-
$product_thumb_url = isset($product_thumb['0']) ? esc_url_raw($product_thumb['0']) : '';
|
204 |
-
|
205 |
-
$layout_options = get_post_meta($post_id,'layout_options', true);
|
206 |
-
$layout_preview_img = !empty($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : 'https://i.imgur.com/JyurCtY.jpg';
|
207 |
-
|
208 |
-
$product_thumb_url = !empty( $product_thumb_url ) ? $product_thumb_url : $layout_preview_img;
|
209 |
-
|
210 |
-
$item_layout_args[$post_id] = array('name'=>$layout_name, 'link_text'=>'Edit', 'link'=> get_edit_post_link($post_id), 'thumb'=> $product_thumb_url, );
|
211 |
-
|
212 |
-
endwhile;
|
213 |
-
endif;
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
$args = array(
|
220 |
-
'id' => 'layout_id',
|
221 |
-
'parent' => 'post_grid_post_settings',
|
222 |
-
'title' => __('Post template layouts','post-grid'),
|
223 |
-
'details' => __('Choose layout for post template.','post-grid'),
|
224 |
-
'type' => 'radio_image',
|
225 |
-
'value' => $layout_id,
|
226 |
-
'default' => '',
|
227 |
-
'width' => '250px',
|
228 |
-
'args' => $item_layout_args,
|
229 |
-
);
|
230 |
-
|
231 |
-
$settings_tabs_field->generate_field($args);
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
?>
|
236 |
-
</div>
|
237 |
-
<?php
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
}
|
242 |
-
|
7 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
8 |
|
9 |
|
|
|
|
|
10 |
add_action('post_grid_post_options_content_options', 'post_grid_post_options_content_options',10, 2);
|
11 |
|
12 |
function post_grid_post_options_content_options($tab, $post_id){
|
78 |
|
79 |
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/settings-hook.php
CHANGED
@@ -86,6 +86,16 @@ if(!function_exists('post_grid_settings_content_help_support')) {
|
|
86 |
|
87 |
$settings_tabs_field = new settings_tabs_field();
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
?>
|
90 |
<div class="section">
|
91 |
<div class="section-title"><?php echo __('Get support', 'post-grid'); ?></div>
|
@@ -93,6 +103,84 @@ if(!function_exists('post_grid_settings_content_help_support')) {
|
|
93 |
|
94 |
<?php
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
ob_start();
|
98 |
?>
|
@@ -303,7 +391,46 @@ if(!function_exists('post_grid_settings_content_buy_pro')) {
|
|
303 |
</tr>
|
304 |
|
305 |
|
|
|
|
|
|
|
|
|
|
|
306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
|
309 |
|
@@ -428,19 +555,17 @@ if(!function_exists('post_grid_settings_content_buy_pro')) {
|
|
428 |
</tr>
|
429 |
|
430 |
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
<tr>
|
438 |
<td colspan="3" class="col-features">
|
439 |
<h3><?php echo __('View Types','post-grid'); ?></h3>
|
440 |
</td>
|
441 |
</tr>
|
442 |
|
443 |
-
|
|
|
|
|
|
|
|
|
444 |
<tr>
|
445 |
<td class="col-features"><?php echo __('Filterable','post-grid'); ?> </td>
|
446 |
<td><i class="fas fa-times"></i></td>
|
@@ -687,6 +812,7 @@ if(!function_exists('post_grid_settings_content_buy_pro')) {
|
|
687 |
<td><i class="fas fa-times"></i></td>
|
688 |
<td><i class="fas fa-check"></i></td>
|
689 |
</tr>
|
|
|
690 |
<tr>
|
691 |
<td class="col-features"><?php echo __('WooCommerce','post-grid'); ?> </td>
|
692 |
<td><i class="fas fa-times"></i></td>
|
86 |
|
87 |
$settings_tabs_field = new settings_tabs_field();
|
88 |
|
89 |
+
if (is_plugin_active('post-grid-pro/post-grid-pro.php')){
|
90 |
+
$layouts_pro_url = post_grid_pro_plugin_url.'sample-data/post-grid-layouts.xml';
|
91 |
+
$layouts_pro_url_json = post_grid_pro_plugin_url.'sample-data/post-grid-layouts.json';
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
$layouts_free_url = post_grid_plugin_url.'sample-data/post-grid-layouts.xml';
|
96 |
+
$layouts_free_url_json = post_grid_plugin_url.'sample-data/post-grid-layouts.json';
|
97 |
+
|
98 |
+
|
99 |
?>
|
100 |
<div class="section">
|
101 |
<div class="section-title"><?php echo __('Get support', 'post-grid'); ?></div>
|
103 |
|
104 |
<?php
|
105 |
|
106 |
+
ob_start();
|
107 |
+
?>
|
108 |
+
|
109 |
+
<p><b>Post Gird</b> provide some ready layouts to get started, please follow the steps bellow to import default layouts.</p>
|
110 |
+
|
111 |
+
<a class="button post-grid-import-layouts" href="<?php echo esc_url_raw($layouts_free_url_json); ?>"><?php echo __('Import automatically', 'post-grid'); ?></a>
|
112 |
+
|
113 |
+
|
114 |
+
<p>Import manually</p>
|
115 |
+
|
116 |
+
<ul>
|
117 |
+
<li>Step - 1: Go to <a href="<?php echo admin_url(); ?>import.php">import</a> menu and install & activate <b>WordPress</b> Importer plugin. click to "Install Now" button to install.</li>
|
118 |
+
<li>Step - 2: Download following xml file by clicking button bellow, save the file on your local machine.</li>
|
119 |
+
<li>Step - 3: Go to importer page <a href="<?php echo admin_url(); ?>import.php?import=wordpress">Import WordPress</a> and chose the downloaded file and then click to <b>Upload file and import</b>.</li>
|
120 |
+
<li>Step - 4: Go to <a href="<?php echo admin_url(); ?>edit.php?post_type=post_grid_layout">Post Grid layouts</a> page to see imported layouts.</li>
|
121 |
+
</ul>
|
122 |
+
|
123 |
+
<p><?php echo __('Download free layouts', 'post-grid'); ?></p>
|
124 |
+
<a class="button" href="<?php echo esc_url_raw($layouts_free_url); ?>"><?php echo __('Download XML', 'post-grid'); ?></a>
|
125 |
+
|
126 |
+
|
127 |
+
<?php
|
128 |
+
if($layouts_pro_url):
|
129 |
+
?>
|
130 |
+
<p><?php echo __('Download premium layouts', 'post-grid'); ?></p>
|
131 |
+
<a class="button" href="<?php echo esc_url_raw($layouts_pro_url); ?>"><?php echo __('Download Pro XML', 'post-grid'); ?></a>
|
132 |
+
<a class="button post-grid-import-layouts" href="<?php echo esc_url_raw($layouts_pro_url_json); ?>"><?php echo __('Import automatically', 'post-grid'); ?></a>
|
133 |
+
|
134 |
+
<?php
|
135 |
+
endif;
|
136 |
+
?>
|
137 |
+
|
138 |
+
|
139 |
+
<?php
|
140 |
+
|
141 |
+
$html = ob_get_clean();
|
142 |
+
|
143 |
+
$args = array(
|
144 |
+
'id' => 'import_layouts',
|
145 |
+
//'parent' => '',
|
146 |
+
'title' => __('Import layouts','post-grid'),
|
147 |
+
'details' => '',
|
148 |
+
'type' => 'custom_html',
|
149 |
+
'html' => $html,
|
150 |
+
|
151 |
+
);
|
152 |
+
|
153 |
+
$settings_tabs_field->generate_field($args);
|
154 |
+
|
155 |
+
|
156 |
+
|
157 |
+
ob_start();
|
158 |
+
?>
|
159 |
+
<ul>
|
160 |
+
<li>Step - 1: Go to Tools > <a href="<?php echo admin_url(); ?>export.php">Export</a> menu.</li>
|
161 |
+
<li>Step - 2: Choose "Layouts" post types from list.</li>
|
162 |
+
<li>Step - 3: Then click to "Download Export File' button.</li>
|
163 |
+
<li>Step - 4: Save the file on your local machine.</li>
|
164 |
+
</ul>
|
165 |
+
|
166 |
+
<?php
|
167 |
+
|
168 |
+
$html = ob_get_clean();
|
169 |
+
|
170 |
+
$args = array(
|
171 |
+
'id' => 'export_layouts',
|
172 |
+
//'parent' => '',
|
173 |
+
'title' => __('Export layouts','post-grid'),
|
174 |
+
'details' => '',
|
175 |
+
'type' => 'custom_html',
|
176 |
+
'html' => $html,
|
177 |
+
|
178 |
+
);
|
179 |
+
|
180 |
+
$settings_tabs_field->generate_field($args);
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
|
185 |
ob_start();
|
186 |
?>
|
391 |
</tr>
|
392 |
|
393 |
|
394 |
+
<tr>
|
395 |
+
<td colspan="3" class="col-features">
|
396 |
+
<h3><?php echo __('Layouts library','post-grid'); ?></h3>
|
397 |
+
</td>
|
398 |
+
</tr>
|
399 |
|
400 |
+
<tr>
|
401 |
+
<td class="col-features"><?php echo __('5 free layouts','post-grid'); ?> </td>
|
402 |
+
<td><i class="fas fa-check"></i></td>
|
403 |
+
<td><i class="fas fa-check"></i></td>
|
404 |
+
</tr>
|
405 |
+
|
406 |
+
<tr>
|
407 |
+
<td class="col-features"><?php echo __('32 pro layouts','post-grid'); ?> </td>
|
408 |
+
<td><i class="fas fa-times"></i></td>
|
409 |
+
<td><i class="fas fa-check"></i></td>
|
410 |
+
</tr>
|
411 |
+
|
412 |
+
<tr>
|
413 |
+
<td class="col-features"><?php echo __('20+ elements','post-grid'); ?> </td>
|
414 |
+
<td><i class="fas fa-check"></i></td>
|
415 |
+
<td><i class="fas fa-check"></i></td>
|
416 |
+
</tr>
|
417 |
+
|
418 |
+
<tr>
|
419 |
+
<td class="col-features"><?php echo __('Element - Custom meta field','post-grid'); ?> </td>
|
420 |
+
<td><i class="fas fa-times"></i></td>
|
421 |
+
<td><i class="fas fa-check"></i></td>
|
422 |
+
</tr>
|
423 |
+
|
424 |
+
<tr>
|
425 |
+
<td class="col-features"><?php echo __('Element - Custom HTML','post-grid'); ?> </td>
|
426 |
+
<td><i class="fas fa-times"></i></td>
|
427 |
+
<td><i class="fas fa-check"></i></td>
|
428 |
+
</tr>
|
429 |
+
<tr>
|
430 |
+
<td class="col-features"><?php echo __('Element - Taxonomy & terms','post-grid'); ?> </td>
|
431 |
+
<td><i class="fas fa-times"></i></td>
|
432 |
+
<td><i class="fas fa-check"></i></td>
|
433 |
+
</tr>
|
434 |
|
435 |
|
436 |
|
555 |
</tr>
|
556 |
|
557 |
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
<tr>
|
559 |
<td colspan="3" class="col-features">
|
560 |
<h3><?php echo __('View Types','post-grid'); ?></h3>
|
561 |
</td>
|
562 |
</tr>
|
563 |
|
564 |
+
<tr>
|
565 |
+
<td class="col-features"><?php echo __('Normal Grid','post-grid'); ?> </td>
|
566 |
+
<td><i class="fas fa-check"></i></td>
|
567 |
+
<td><i class="fas fa-check"></i></td>
|
568 |
+
</tr>
|
569 |
<tr>
|
570 |
<td class="col-features"><?php echo __('Filterable','post-grid'); ?> </td>
|
571 |
<td><i class="fas fa-times"></i></td>
|
812 |
<td><i class="fas fa-times"></i></td>
|
813 |
<td><i class="fas fa-check"></i></td>
|
814 |
</tr>
|
815 |
+
|
816 |
<tr>
|
817 |
<td class="col-features"><?php echo __('WooCommerce','post-grid'); ?> </td>
|
818 |
<td><i class="fas fa-times"></i></td>
|
post-grid.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Post Grid by PickPlugins
|
4 |
Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
|
5 |
Description: Awesome post grid for query post from any post type and display on grid.
|
6 |
-
Version: 2.0.
|
7 |
Author: PickPlugins
|
8 |
Author URI: https://www.pickplugins.com/
|
9 |
License: GPLv2 or later
|
@@ -21,7 +21,7 @@ if( !class_exists( 'PostGrid' )){
|
|
21 |
define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
|
22 |
define('post_grid_plugin_basename', plugin_basename(__FILE__));
|
23 |
define('post_grid_plugin_name', 'Post Grid');
|
24 |
-
define('post_grid_version', '2.0.
|
25 |
|
26 |
|
27 |
|
@@ -31,6 +31,7 @@ if( !class_exists( 'PostGrid' )){
|
|
31 |
include('includes/classes/class-shortcodes.php');
|
32 |
include('includes/classes/class-settings.php');
|
33 |
include('includes/classes/class-settings-tabs.php');
|
|
|
34 |
|
35 |
include('includes/metabox-post-grid-layout-hook.php');
|
36 |
include('includes/metabox-post-grid-hook.php');
|
@@ -44,7 +45,7 @@ if( !class_exists( 'PostGrid' )){
|
|
44 |
|
45 |
|
46 |
include('includes/functions-data-upgrade.php');
|
47 |
-
include('includes/functions-single.php');
|
48 |
|
49 |
|
50 |
include('includes/classes/class-post-grid-support.php');
|
@@ -154,6 +155,9 @@ if( !class_exists( 'PostGrid' )){
|
|
154 |
wp_register_script('select2', post_grid_plugin_url.'assets/admin/js/select2.full.js', array('jquery'));
|
155 |
wp_register_style( 'select2', post_grid_plugin_url . 'assets/admin/css/select2.min.css');
|
156 |
|
|
|
|
|
|
|
157 |
wp_enqueue_style('post_grid_skin', post_grid_plugin_url . 'assets/global/css/style.skins.css');
|
158 |
|
159 |
wp_register_style('jquery-ui', post_grid_plugin_url.'assets/admin/css/jquery-ui.css');
|
@@ -169,6 +173,7 @@ if( !class_exists( 'PostGrid' )){
|
|
169 |
wp_register_script('layout-editor', post_grid_plugin_url.'assets/admin/js/layout-editor.js', array('jquery'));
|
170 |
wp_register_style('bootstrap-grid', post_grid_plugin_url.'assets/global/css/bootstrap-grid.css');
|
171 |
|
|
|
172 |
|
173 |
if ($screen->id == 'post_grid'){
|
174 |
|
@@ -206,6 +211,12 @@ if( !class_exists( 'PostGrid' )){
|
|
206 |
|
207 |
|
208 |
if ($screen->id == 'post_grid_page_post-grid-settings'){
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
$settings_tabs_field = new settings_tabs_field();
|
210 |
$settings_tabs_field->admin_scripts();
|
211 |
}
|
3 |
Plugin Name: Post Grid by PickPlugins
|
4 |
Plugin URI: https://www.pickplugins.com/item/post-grid-create-awesome-grid-from-any-post-type-for-wordpress/
|
5 |
Description: Awesome post grid for query post from any post type and display on grid.
|
6 |
+
Version: 2.0.60
|
7 |
Author: PickPlugins
|
8 |
Author URI: https://www.pickplugins.com/
|
9 |
License: GPLv2 or later
|
21 |
define('post_grid_plugin_dir', plugin_dir_path(__FILE__));
|
22 |
define('post_grid_plugin_basename', plugin_basename(__FILE__));
|
23 |
define('post_grid_plugin_name', 'Post Grid');
|
24 |
+
define('post_grid_version', '2.0.60');
|
25 |
|
26 |
|
27 |
|
31 |
include('includes/classes/class-shortcodes.php');
|
32 |
include('includes/classes/class-settings.php');
|
33 |
include('includes/classes/class-settings-tabs.php');
|
34 |
+
include('includes/classes/class-admin-notices.php');
|
35 |
|
36 |
include('includes/metabox-post-grid-layout-hook.php');
|
37 |
include('includes/metabox-post-grid-hook.php');
|
45 |
|
46 |
|
47 |
include('includes/functions-data-upgrade.php');
|
48 |
+
//include('includes/functions-single.php');
|
49 |
|
50 |
|
51 |
include('includes/classes/class-post-grid-support.php');
|
155 |
wp_register_script('select2', post_grid_plugin_url.'assets/admin/js/select2.full.js', array('jquery'));
|
156 |
wp_register_style( 'select2', post_grid_plugin_url . 'assets/admin/css/select2.min.css');
|
157 |
|
158 |
+
wp_register_script('jquery.lazy', post_grid_plugin_url.'assets/admin/js/jquery.lazy.js', array('jquery'));
|
159 |
+
|
160 |
+
|
161 |
wp_enqueue_style('post_grid_skin', post_grid_plugin_url . 'assets/global/css/style.skins.css');
|
162 |
|
163 |
wp_register_style('jquery-ui', post_grid_plugin_url.'assets/admin/css/jquery-ui.css');
|
173 |
wp_register_script('layout-editor', post_grid_plugin_url.'assets/admin/js/layout-editor.js', array('jquery'));
|
174 |
wp_register_style('bootstrap-grid', post_grid_plugin_url.'assets/global/css/bootstrap-grid.css');
|
175 |
|
176 |
+
wp_register_style('post-grid-addons', post_grid_plugin_url.'assets/admin/css/addons.css');
|
177 |
|
178 |
if ($screen->id == 'post_grid'){
|
179 |
|
211 |
|
212 |
|
213 |
if ($screen->id == 'post_grid_page_post-grid-settings'){
|
214 |
+
|
215 |
+
wp_enqueue_script('post_grid_admin_js');
|
216 |
+
wp_localize_script('post_grid_admin_js', 'post_grid_ajax', array('post_grid_ajaxurl' => admin_url('admin-ajax.php')));
|
217 |
+
wp_enqueue_style('select2');
|
218 |
+
wp_enqueue_script('select2');
|
219 |
+
|
220 |
$settings_tabs_field = new settings_tabs_field();
|
221 |
$settings_tabs_field->admin_scripts();
|
222 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.4
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -216,6 +216,12 @@ then paste this shortcode anywhere in your page to display grid<br />
|
|
216 |
|
217 |
== Changelog ==
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
= 2.0.59 =
|
220 |
* 2020-05-21 add - Elements added for "WCK - Custom Fields and Custom Post Types Creator" plugin
|
221 |
* 2020-05-21 add - Elements added for "WP Job Manager" plugin
|
4 |
Tags: post grid, grid, custom post grid, post type grid, grid display, category filter, custom post, filter, filtering, grid, layout, list, masonry, post, post filter, post layout, taxonomy, taxonomy filter,
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 2.0.60
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
216 |
|
217 |
== Changelog ==
|
218 |
|
219 |
+
= 2.0.60 =
|
220 |
+
* 2020-05-24 add - addon "Search & Filter" added
|
221 |
+
* 2020-05-24 add - addon "Post/Page Templates" added
|
222 |
+
* 2020-05-29 add - import layouts notice added.
|
223 |
+
|
224 |
+
|
225 |
= 2.0.59 =
|
226 |
* 2020-05-21 add - Elements added for "WCK - Custom Fields and Custom Post Types Creator" plugin
|
227 |
* 2020-05-21 add - Elements added for "WP Job Manager" plugin
|
sample-data/post-grid-layouts.json
ADDED
@@ -0,0 +1,899 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"rss": {
|
3 |
+
"channel": {
|
4 |
+
"title": "Post Grid",
|
5 |
+
"link": "http://localhost/wp-multi/post-grid",
|
6 |
+
"description": "Just another WordPress Multi Sites site",
|
7 |
+
"pubDate": "Thu, 28 May 2020 16:16:28 +0000",
|
8 |
+
"language": "en-US",
|
9 |
+
"wxr_version": {
|
10 |
+
"__prefix": "wp",
|
11 |
+
"__text": "1.2"
|
12 |
+
},
|
13 |
+
"base_site_url": {
|
14 |
+
"__prefix": "wp",
|
15 |
+
"__text": "http://localhost/wp-multi/"
|
16 |
+
},
|
17 |
+
"base_blog_url": {
|
18 |
+
"__prefix": "wp",
|
19 |
+
"__text": "http://localhost/wp-multi/post-grid"
|
20 |
+
},
|
21 |
+
"author": {
|
22 |
+
"author_id": {
|
23 |
+
"__prefix": "wp",
|
24 |
+
"__text": "1"
|
25 |
+
},
|
26 |
+
"author_login": {
|
27 |
+
"__prefix": "wp",
|
28 |
+
"__cdata": "admin"
|
29 |
+
},
|
30 |
+
"author_email": {
|
31 |
+
"__prefix": "wp",
|
32 |
+
"__cdata": "public.nurhasan@gmail.com"
|
33 |
+
},
|
34 |
+
"author_display_name": {
|
35 |
+
"__prefix": "wp",
|
36 |
+
"__cdata": ""
|
37 |
+
},
|
38 |
+
"author_first_name": {
|
39 |
+
"__prefix": "wp",
|
40 |
+
"__cdata": "Nur"
|
41 |
+
},
|
42 |
+
"author_last_name": {
|
43 |
+
"__prefix": "wp",
|
44 |
+
"__cdata": "Hasan"
|
45 |
+
},
|
46 |
+
"__prefix": "wp"
|
47 |
+
},
|
48 |
+
"generator": "https://wordpress.org/?v=5.4",
|
49 |
+
"item": [
|
50 |
+
{
|
51 |
+
"title": "Layout - Flat",
|
52 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat/",
|
53 |
+
"pubDate": "Sat, 18 Apr 2020 05:27:40 +0000",
|
54 |
+
"creator": {
|
55 |
+
"__prefix": "dc",
|
56 |
+
"__cdata": "admin"
|
57 |
+
},
|
58 |
+
"guid": {
|
59 |
+
"_isPermaLink": "false",
|
60 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51600"
|
61 |
+
},
|
62 |
+
"description": "",
|
63 |
+
"encoded": [
|
64 |
+
{
|
65 |
+
"__prefix": "content",
|
66 |
+
"__cdata": ""
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"__prefix": "excerpt",
|
70 |
+
"__cdata": ""
|
71 |
+
}
|
72 |
+
],
|
73 |
+
"post_id": {
|
74 |
+
"__prefix": "wp",
|
75 |
+
"__text": "51600"
|
76 |
+
},
|
77 |
+
"post_date": {
|
78 |
+
"__prefix": "wp",
|
79 |
+
"__cdata": "2020-04-18 05:27:40"
|
80 |
+
},
|
81 |
+
"post_date_gmt": {
|
82 |
+
"__prefix": "wp",
|
83 |
+
"__cdata": "2020-04-18 05:27:40"
|
84 |
+
},
|
85 |
+
"comment_status": {
|
86 |
+
"__prefix": "wp",
|
87 |
+
"__cdata": "closed"
|
88 |
+
},
|
89 |
+
"ping_status": {
|
90 |
+
"__prefix": "wp",
|
91 |
+
"__cdata": "closed"
|
92 |
+
},
|
93 |
+
"post_name": {
|
94 |
+
"__prefix": "wp",
|
95 |
+
"__cdata": "layout-flat"
|
96 |
+
},
|
97 |
+
"status": {
|
98 |
+
"__prefix": "wp",
|
99 |
+
"__cdata": "publish"
|
100 |
+
},
|
101 |
+
"post_parent": {
|
102 |
+
"__prefix": "wp",
|
103 |
+
"__text": "0"
|
104 |
+
},
|
105 |
+
"menu_order": {
|
106 |
+
"__prefix": "wp",
|
107 |
+
"__text": "0"
|
108 |
+
},
|
109 |
+
"post_type": {
|
110 |
+
"__prefix": "wp",
|
111 |
+
"__cdata": "post_grid_layout"
|
112 |
+
},
|
113 |
+
"post_password": {
|
114 |
+
"__prefix": "wp",
|
115 |
+
"__cdata": ""
|
116 |
+
},
|
117 |
+
"is_sticky": {
|
118 |
+
"__prefix": "wp",
|
119 |
+
"__text": "0"
|
120 |
+
},
|
121 |
+
"postmeta": [
|
122 |
+
{
|
123 |
+
"meta_key": {
|
124 |
+
"__prefix": "wp",
|
125 |
+
"__cdata": "_edit_last"
|
126 |
+
},
|
127 |
+
"meta_value": {
|
128 |
+
"__prefix": "wp",
|
129 |
+
"__cdata": "1"
|
130 |
+
},
|
131 |
+
"__prefix": "wp"
|
132 |
+
},
|
133 |
+
{
|
134 |
+
"meta_key": {
|
135 |
+
"__prefix": "wp",
|
136 |
+
"__cdata": "layout_options"
|
137 |
+
},
|
138 |
+
"meta_value": {
|
139 |
+
"__prefix": "wp",
|
140 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/p0wi9sx.png\";}"
|
141 |
+
},
|
142 |
+
"__prefix": "wp"
|
143 |
+
},
|
144 |
+
{
|
145 |
+
"meta_key": {
|
146 |
+
"__prefix": "wp",
|
147 |
+
"__cdata": "layout_elements_data"
|
148 |
+
},
|
149 |
+
"meta_value": {
|
150 |
+
"__prefix": "wp",
|
151 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:59:\"http://localhost/wp/wp-content/uploads/2020/02/single-1.jpg\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:4:\"none\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:11:\"auto_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:11:\"auto_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:0:\"\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:5:\"5px 0\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"20\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:5:\"_self\";s:6:\"margin\";s:5:\"0px 0\";s:5:\"color\";s:0:\"\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
152 |
+
},
|
153 |
+
"__prefix": "wp"
|
154 |
+
},
|
155 |
+
{
|
156 |
+
"meta_key": {
|
157 |
+
"__prefix": "wp",
|
158 |
+
"__cdata": "custom_scripts"
|
159 |
+
},
|
160 |
+
"meta_value": {
|
161 |
+
"__prefix": "wp",
|
162 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:94:\".__ID__ a{text-decoration:none}.__ID__{vertical-align:top}.__ID__ .layer-content{padding:10px}\";s:9:\"custom_js\";s:0:\"\";}"
|
163 |
+
},
|
164 |
+
"__prefix": "wp"
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"meta_key": {
|
168 |
+
"__prefix": "wp",
|
169 |
+
"__cdata": "post_grid_post_settings"
|
170 |
+
},
|
171 |
+
"meta_value": {
|
172 |
+
"__prefix": "wp",
|
173 |
+
"__cdata": "a:14:{s:19:\"custom_thumb_source\";s:91:\"http://localhost/wp/wp-content/plugins/post-grid/assets/frontend/css/images/placeholder.png\";s:16:\"thumb_custom_url\";s:0:\"\";s:9:\"layout_id\";s:5:\"51600\";s:17:\"font_awesome_icon\";s:0:\"\";s:23:\"font_awesome_icon_color\";s:0:\"\";s:22:\"font_awesome_icon_size\";s:0:\"\";s:17:\"custom_youtube_id\";s:0:\"\";s:15:\"custom_vimeo_id\";s:0:\"\";s:21:\"custom_dailymotion_id\";s:0:\"\";s:14:\"custom_mp3_url\";s:0:\"\";s:20:\"custom_soundcloud_id\";s:0:\"\";s:16:\"custom_video_MP4\";s:0:\"\";s:16:\"custom_video_OGV\";s:0:\"\";s:17:\"custom_video_WEBM\";s:0:\"\";}"
|
174 |
+
},
|
175 |
+
"__prefix": "wp"
|
176 |
+
},
|
177 |
+
{
|
178 |
+
"meta_key": {
|
179 |
+
"__prefix": "wp",
|
180 |
+
"__cdata": "_wp_old_slug"
|
181 |
+
},
|
182 |
+
"meta_value": {
|
183 |
+
"__prefix": "wp",
|
184 |
+
"__cdata": "layout-flat__trashed"
|
185 |
+
},
|
186 |
+
"__prefix": "wp"
|
187 |
+
}
|
188 |
+
]
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"title": "Layout - Flip-x",
|
192 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-flip-x-2/",
|
193 |
+
"pubDate": "Sat, 18 Apr 2020 14:03:17 +0000",
|
194 |
+
"creator": {
|
195 |
+
"__prefix": "dc",
|
196 |
+
"__cdata": "admin"
|
197 |
+
},
|
198 |
+
"guid": {
|
199 |
+
"_isPermaLink": "false",
|
200 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51612"
|
201 |
+
},
|
202 |
+
"description": "",
|
203 |
+
"encoded": [
|
204 |
+
{
|
205 |
+
"__prefix": "content",
|
206 |
+
"__cdata": ""
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"__prefix": "excerpt",
|
210 |
+
"__cdata": ""
|
211 |
+
}
|
212 |
+
],
|
213 |
+
"post_id": {
|
214 |
+
"__prefix": "wp",
|
215 |
+
"__text": "51612"
|
216 |
+
},
|
217 |
+
"post_date": {
|
218 |
+
"__prefix": "wp",
|
219 |
+
"__cdata": "2020-04-18 14:03:17"
|
220 |
+
},
|
221 |
+
"post_date_gmt": {
|
222 |
+
"__prefix": "wp",
|
223 |
+
"__cdata": "2020-04-18 14:03:17"
|
224 |
+
},
|
225 |
+
"comment_status": {
|
226 |
+
"__prefix": "wp",
|
227 |
+
"__cdata": "closed"
|
228 |
+
},
|
229 |
+
"ping_status": {
|
230 |
+
"__prefix": "wp",
|
231 |
+
"__cdata": "closed"
|
232 |
+
},
|
233 |
+
"post_name": {
|
234 |
+
"__prefix": "wp",
|
235 |
+
"__cdata": "layout-flip-x-2"
|
236 |
+
},
|
237 |
+
"status": {
|
238 |
+
"__prefix": "wp",
|
239 |
+
"__cdata": "publish"
|
240 |
+
},
|
241 |
+
"post_parent": {
|
242 |
+
"__prefix": "wp",
|
243 |
+
"__text": "0"
|
244 |
+
},
|
245 |
+
"menu_order": {
|
246 |
+
"__prefix": "wp",
|
247 |
+
"__text": "0"
|
248 |
+
},
|
249 |
+
"post_type": {
|
250 |
+
"__prefix": "wp",
|
251 |
+
"__cdata": "post_grid_layout"
|
252 |
+
},
|
253 |
+
"post_password": {
|
254 |
+
"__prefix": "wp",
|
255 |
+
"__cdata": ""
|
256 |
+
},
|
257 |
+
"is_sticky": {
|
258 |
+
"__prefix": "wp",
|
259 |
+
"__text": "0"
|
260 |
+
},
|
261 |
+
"postmeta": [
|
262 |
+
{
|
263 |
+
"meta_key": {
|
264 |
+
"__prefix": "wp",
|
265 |
+
"__cdata": "layout_options"
|
266 |
+
},
|
267 |
+
"meta_value": {
|
268 |
+
"__prefix": "wp",
|
269 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/Yk1lKJw.gif\";}"
|
270 |
+
},
|
271 |
+
"__prefix": "wp"
|
272 |
+
},
|
273 |
+
{
|
274 |
+
"meta_key": {
|
275 |
+
"__prefix": "wp",
|
276 |
+
"__cdata": "layout_elements_data"
|
277 |
+
},
|
278 |
+
"meta_value": {
|
279 |
+
"__prefix": "wp",
|
280 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:0:\"\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:11:\"auto_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:11:\"auto_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:3:\"0px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:0:\"\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:5:\"5px 0\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"25\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:6:\"_blank\";s:6:\"margin\";s:6:\"10px 0\";s:5:\"color\";s:0:\"\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
281 |
+
},
|
282 |
+
"__prefix": "wp"
|
283 |
+
},
|
284 |
+
{
|
285 |
+
"meta_key": {
|
286 |
+
"__prefix": "wp",
|
287 |
+
"__cdata": "custom_scripts"
|
288 |
+
},
|
289 |
+
"meta_value": {
|
290 |
+
"__prefix": "wp",
|
291 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:1285:\".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;padding:0;-webkit-perspective:600px;perspective:600px;position:relative;vertical-align:top;width:100%}.__ID__:hover .layer-media{background:#fff none repeat scroll 0 0;-webkit-transform:rotateX(180deg);transform:rotateX(180deg);z-index:900}.__ID__ .layer-media{-webkit-backface-visibility:hidden;backface-visibility:hidden;background:#fff none repeat scroll 0 0;float:none;height:inherit;left:0;text-align:center;top:0;-webkit-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition:all .4s ease-in-out 0s;transition:all .4s ease-in-out 0s;width:inherit;z-index:900}.__ID__:hover .layer-content{background:#fff none repeat scroll 0 0;-webkit-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0);z-index:1000}.__ID__ .layer-content{-webkit-backface-visibility:hidden;backface-visibility:hidden;background:#fff none repeat scroll 0 0;float:none;height:inherit;left:0;padding:0;position:absolute;top:0;-webkit-transform:rotateX(-179deg);transform:rotateX(-179deg);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition:all .4s ease-in-out 0s;transition:all .4s ease-in-out 0s;width:inherit;z-index:800;}\";s:9:\"custom_js\";s:0:\"\";}"
|
292 |
+
},
|
293 |
+
"__prefix": "wp"
|
294 |
+
},
|
295 |
+
{
|
296 |
+
"meta_key": {
|
297 |
+
"__prefix": "wp",
|
298 |
+
"__cdata": "_dp_original"
|
299 |
+
},
|
300 |
+
"meta_value": {
|
301 |
+
"__prefix": "wp",
|
302 |
+
"__cdata": "51600"
|
303 |
+
},
|
304 |
+
"__prefix": "wp"
|
305 |
+
},
|
306 |
+
{
|
307 |
+
"meta_key": {
|
308 |
+
"__prefix": "wp",
|
309 |
+
"__cdata": "_edit_last"
|
310 |
+
},
|
311 |
+
"meta_value": {
|
312 |
+
"__prefix": "wp",
|
313 |
+
"__cdata": "1"
|
314 |
+
},
|
315 |
+
"__prefix": "wp"
|
316 |
+
},
|
317 |
+
{
|
318 |
+
"meta_key": {
|
319 |
+
"__prefix": "wp",
|
320 |
+
"__cdata": "_wp_old_slug"
|
321 |
+
},
|
322 |
+
"meta_value": {
|
323 |
+
"__prefix": "wp",
|
324 |
+
"__cdata": "layout-flip-x-2__trashed"
|
325 |
+
},
|
326 |
+
"__prefix": "wp"
|
327 |
+
}
|
328 |
+
]
|
329 |
+
},
|
330 |
+
{
|
331 |
+
"title": "Layout - Thumb go Left",
|
332 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-thumbgoleft/",
|
333 |
+
"pubDate": "Sat, 18 Apr 2020 14:03:45 +0000",
|
334 |
+
"creator": {
|
335 |
+
"__prefix": "dc",
|
336 |
+
"__cdata": "admin"
|
337 |
+
},
|
338 |
+
"guid": {
|
339 |
+
"_isPermaLink": "false",
|
340 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51613"
|
341 |
+
},
|
342 |
+
"description": "",
|
343 |
+
"encoded": [
|
344 |
+
{
|
345 |
+
"__prefix": "content",
|
346 |
+
"__cdata": ""
|
347 |
+
},
|
348 |
+
{
|
349 |
+
"__prefix": "excerpt",
|
350 |
+
"__cdata": ""
|
351 |
+
}
|
352 |
+
],
|
353 |
+
"post_id": {
|
354 |
+
"__prefix": "wp",
|
355 |
+
"__text": "51613"
|
356 |
+
},
|
357 |
+
"post_date": {
|
358 |
+
"__prefix": "wp",
|
359 |
+
"__cdata": "2020-04-18 14:03:45"
|
360 |
+
},
|
361 |
+
"post_date_gmt": {
|
362 |
+
"__prefix": "wp",
|
363 |
+
"__cdata": "2020-04-18 14:03:45"
|
364 |
+
},
|
365 |
+
"comment_status": {
|
366 |
+
"__prefix": "wp",
|
367 |
+
"__cdata": "closed"
|
368 |
+
},
|
369 |
+
"ping_status": {
|
370 |
+
"__prefix": "wp",
|
371 |
+
"__cdata": "closed"
|
372 |
+
},
|
373 |
+
"post_name": {
|
374 |
+
"__prefix": "wp",
|
375 |
+
"__cdata": "layout-thumbgoleft"
|
376 |
+
},
|
377 |
+
"status": {
|
378 |
+
"__prefix": "wp",
|
379 |
+
"__cdata": "publish"
|
380 |
+
},
|
381 |
+
"post_parent": {
|
382 |
+
"__prefix": "wp",
|
383 |
+
"__text": "0"
|
384 |
+
},
|
385 |
+
"menu_order": {
|
386 |
+
"__prefix": "wp",
|
387 |
+
"__text": "0"
|
388 |
+
},
|
389 |
+
"post_type": {
|
390 |
+
"__prefix": "wp",
|
391 |
+
"__cdata": "post_grid_layout"
|
392 |
+
},
|
393 |
+
"post_password": {
|
394 |
+
"__prefix": "wp",
|
395 |
+
"__cdata": ""
|
396 |
+
},
|
397 |
+
"is_sticky": {
|
398 |
+
"__prefix": "wp",
|
399 |
+
"__text": "0"
|
400 |
+
},
|
401 |
+
"postmeta": [
|
402 |
+
{
|
403 |
+
"meta_key": {
|
404 |
+
"__prefix": "wp",
|
405 |
+
"__cdata": "layout_options"
|
406 |
+
},
|
407 |
+
"meta_value": {
|
408 |
+
"__prefix": "wp",
|
409 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/V4ADgV7.gif\";}"
|
410 |
+
},
|
411 |
+
"__prefix": "wp"
|
412 |
+
},
|
413 |
+
{
|
414 |
+
"meta_key": {
|
415 |
+
"__prefix": "wp",
|
416 |
+
"__cdata": "layout_elements_data"
|
417 |
+
},
|
418 |
+
"meta_value": {
|
419 |
+
"__prefix": "wp",
|
420 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:0:\"\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:11:\"auto_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:11:\"auto_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:4:\"10px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:0:\"\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:5:\"5px 0\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"20\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:6:\"_blank\";s:6:\"margin\";s:6:\"10px 0\";s:5:\"color\";s:0:\"\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
421 |
+
},
|
422 |
+
"__prefix": "wp"
|
423 |
+
},
|
424 |
+
{
|
425 |
+
"meta_key": {
|
426 |
+
"__prefix": "wp",
|
427 |
+
"__cdata": "custom_scripts"
|
428 |
+
},
|
429 |
+
"meta_value": {
|
430 |
+
"__prefix": "wp",
|
431 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:510:\".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;position:relative;vertical-align:top}.__ID__:hover .layer-media{opacity:0;-webkit-transform:scale(.5) translateX(-100%);-ms-transform:scale(.5) translateX(-100%);transform:scale(.5) translateX(-100%)}.__ID__ .layer-media{-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s;width:100%}.__ID__:hover .layer-content{opacity:1}.__ID__ .layer-content{left:0;opacity:0;position:absolute;top:0;-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s}\";s:9:\"custom_js\";s:0:\"\";}"
|
432 |
+
},
|
433 |
+
"__prefix": "wp"
|
434 |
+
},
|
435 |
+
{
|
436 |
+
"meta_key": {
|
437 |
+
"__prefix": "wp",
|
438 |
+
"__cdata": "_dp_original"
|
439 |
+
},
|
440 |
+
"meta_value": {
|
441 |
+
"__prefix": "wp",
|
442 |
+
"__cdata": "51600"
|
443 |
+
},
|
444 |
+
"__prefix": "wp"
|
445 |
+
},
|
446 |
+
{
|
447 |
+
"meta_key": {
|
448 |
+
"__prefix": "wp",
|
449 |
+
"__cdata": "_edit_last"
|
450 |
+
},
|
451 |
+
"meta_value": {
|
452 |
+
"__prefix": "wp",
|
453 |
+
"__cdata": "1"
|
454 |
+
},
|
455 |
+
"__prefix": "wp"
|
456 |
+
},
|
457 |
+
{
|
458 |
+
"meta_key": {
|
459 |
+
"__prefix": "wp",
|
460 |
+
"__cdata": "_wp_old_slug"
|
461 |
+
},
|
462 |
+
"meta_value": {
|
463 |
+
"__prefix": "wp",
|
464 |
+
"__cdata": "layout-thumbgoleft__trashed"
|
465 |
+
},
|
466 |
+
"__prefix": "wp"
|
467 |
+
}
|
468 |
+
]
|
469 |
+
},
|
470 |
+
{
|
471 |
+
"title": "Layout - Thumb-rounded",
|
472 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-thumbrounded-2/",
|
473 |
+
"pubDate": "Sat, 18 Apr 2020 14:04:05 +0000",
|
474 |
+
"creator": {
|
475 |
+
"__prefix": "dc",
|
476 |
+
"__cdata": "admin"
|
477 |
+
},
|
478 |
+
"guid": {
|
479 |
+
"_isPermaLink": "false",
|
480 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51614"
|
481 |
+
},
|
482 |
+
"description": "",
|
483 |
+
"encoded": [
|
484 |
+
{
|
485 |
+
"__prefix": "content",
|
486 |
+
"__cdata": ""
|
487 |
+
},
|
488 |
+
{
|
489 |
+
"__prefix": "excerpt",
|
490 |
+
"__cdata": ""
|
491 |
+
}
|
492 |
+
],
|
493 |
+
"post_id": {
|
494 |
+
"__prefix": "wp",
|
495 |
+
"__text": "51614"
|
496 |
+
},
|
497 |
+
"post_date": {
|
498 |
+
"__prefix": "wp",
|
499 |
+
"__cdata": "2020-04-18 14:04:05"
|
500 |
+
},
|
501 |
+
"post_date_gmt": {
|
502 |
+
"__prefix": "wp",
|
503 |
+
"__cdata": "2020-04-18 14:04:05"
|
504 |
+
},
|
505 |
+
"comment_status": {
|
506 |
+
"__prefix": "wp",
|
507 |
+
"__cdata": "closed"
|
508 |
+
},
|
509 |
+
"ping_status": {
|
510 |
+
"__prefix": "wp",
|
511 |
+
"__cdata": "closed"
|
512 |
+
},
|
513 |
+
"post_name": {
|
514 |
+
"__prefix": "wp",
|
515 |
+
"__cdata": "layout-thumbrounded-2"
|
516 |
+
},
|
517 |
+
"status": {
|
518 |
+
"__prefix": "wp",
|
519 |
+
"__cdata": "publish"
|
520 |
+
},
|
521 |
+
"post_parent": {
|
522 |
+
"__prefix": "wp",
|
523 |
+
"__text": "0"
|
524 |
+
},
|
525 |
+
"menu_order": {
|
526 |
+
"__prefix": "wp",
|
527 |
+
"__text": "0"
|
528 |
+
},
|
529 |
+
"post_type": {
|
530 |
+
"__prefix": "wp",
|
531 |
+
"__cdata": "post_grid_layout"
|
532 |
+
},
|
533 |
+
"post_password": {
|
534 |
+
"__prefix": "wp",
|
535 |
+
"__cdata": ""
|
536 |
+
},
|
537 |
+
"is_sticky": {
|
538 |
+
"__prefix": "wp",
|
539 |
+
"__text": "0"
|
540 |
+
},
|
541 |
+
"postmeta": [
|
542 |
+
{
|
543 |
+
"meta_key": {
|
544 |
+
"__prefix": "wp",
|
545 |
+
"__cdata": "layout_options"
|
546 |
+
},
|
547 |
+
"meta_value": {
|
548 |
+
"__prefix": "wp",
|
549 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/X9WRLgA.png\";}"
|
550 |
+
},
|
551 |
+
"__prefix": "wp"
|
552 |
+
},
|
553 |
+
{
|
554 |
+
"meta_key": {
|
555 |
+
"__prefix": "wp",
|
556 |
+
"__cdata": "layout_elements_data"
|
557 |
+
},
|
558 |
+
"meta_value": {
|
559 |
+
"__prefix": "wp",
|
560 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:0:\"\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:11:\"auto_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:11:\"auto_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:4:\"10px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:0:\"\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:5:\"5px 0\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"20\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:6:\"_blank\";s:6:\"margin\";s:6:\"10px 0\";s:5:\"color\";s:0:\"\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
561 |
+
},
|
562 |
+
"__prefix": "wp"
|
563 |
+
},
|
564 |
+
{
|
565 |
+
"meta_key": {
|
566 |
+
"__prefix": "wp",
|
567 |
+
"__cdata": "custom_scripts"
|
568 |
+
},
|
569 |
+
"meta_value": {
|
570 |
+
"__prefix": "wp",
|
571 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:125:\".__ID__ a{text-decoration:none}.__ID__ .layer-media{background:#fff none repeat scroll 0 0;border-radius:50%;overflow:hidden}\";s:9:\"custom_js\";s:0:\"\";}"
|
572 |
+
},
|
573 |
+
"__prefix": "wp"
|
574 |
+
},
|
575 |
+
{
|
576 |
+
"meta_key": {
|
577 |
+
"__prefix": "wp",
|
578 |
+
"__cdata": "_dp_original"
|
579 |
+
},
|
580 |
+
"meta_value": {
|
581 |
+
"__prefix": "wp",
|
582 |
+
"__cdata": "51600"
|
583 |
+
},
|
584 |
+
"__prefix": "wp"
|
585 |
+
},
|
586 |
+
{
|
587 |
+
"meta_key": {
|
588 |
+
"__prefix": "wp",
|
589 |
+
"__cdata": "_edit_last"
|
590 |
+
},
|
591 |
+
"meta_value": {
|
592 |
+
"__prefix": "wp",
|
593 |
+
"__cdata": "1"
|
594 |
+
},
|
595 |
+
"__prefix": "wp"
|
596 |
+
},
|
597 |
+
{
|
598 |
+
"meta_key": {
|
599 |
+
"__prefix": "wp",
|
600 |
+
"__cdata": "_wp_old_slug"
|
601 |
+
},
|
602 |
+
"meta_value": {
|
603 |
+
"__prefix": "wp",
|
604 |
+
"__cdata": "layout-thumbrounded-2__trashed"
|
605 |
+
},
|
606 |
+
"__prefix": "wp"
|
607 |
+
}
|
608 |
+
]
|
609 |
+
},
|
610 |
+
{
|
611 |
+
"title": "Layout - Contentbottom",
|
612 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat-2/",
|
613 |
+
"pubDate": "Sat, 18 Apr 2020 14:04:45 +0000",
|
614 |
+
"creator": {
|
615 |
+
"__prefix": "dc",
|
616 |
+
"__cdata": "admin"
|
617 |
+
},
|
618 |
+
"guid": {
|
619 |
+
"_isPermaLink": "false",
|
620 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51615"
|
621 |
+
},
|
622 |
+
"description": "",
|
623 |
+
"encoded": [
|
624 |
+
{
|
625 |
+
"__prefix": "content",
|
626 |
+
"__cdata": ""
|
627 |
+
},
|
628 |
+
{
|
629 |
+
"__prefix": "excerpt",
|
630 |
+
"__cdata": ""
|
631 |
+
}
|
632 |
+
],
|
633 |
+
"post_id": {
|
634 |
+
"__prefix": "wp",
|
635 |
+
"__text": "51615"
|
636 |
+
},
|
637 |
+
"post_date": {
|
638 |
+
"__prefix": "wp",
|
639 |
+
"__cdata": "2020-04-18 14:04:45"
|
640 |
+
},
|
641 |
+
"post_date_gmt": {
|
642 |
+
"__prefix": "wp",
|
643 |
+
"__cdata": "2020-04-18 14:04:45"
|
644 |
+
},
|
645 |
+
"comment_status": {
|
646 |
+
"__prefix": "wp",
|
647 |
+
"__cdata": "closed"
|
648 |
+
},
|
649 |
+
"ping_status": {
|
650 |
+
"__prefix": "wp",
|
651 |
+
"__cdata": "closed"
|
652 |
+
},
|
653 |
+
"post_name": {
|
654 |
+
"__prefix": "wp",
|
655 |
+
"__cdata": "layout-flat-2"
|
656 |
+
},
|
657 |
+
"status": {
|
658 |
+
"__prefix": "wp",
|
659 |
+
"__cdata": "publish"
|
660 |
+
},
|
661 |
+
"post_parent": {
|
662 |
+
"__prefix": "wp",
|
663 |
+
"__text": "0"
|
664 |
+
},
|
665 |
+
"menu_order": {
|
666 |
+
"__prefix": "wp",
|
667 |
+
"__text": "0"
|
668 |
+
},
|
669 |
+
"post_type": {
|
670 |
+
"__prefix": "wp",
|
671 |
+
"__cdata": "post_grid_layout"
|
672 |
+
},
|
673 |
+
"post_password": {
|
674 |
+
"__prefix": "wp",
|
675 |
+
"__cdata": ""
|
676 |
+
},
|
677 |
+
"is_sticky": {
|
678 |
+
"__prefix": "wp",
|
679 |
+
"__text": "0"
|
680 |
+
},
|
681 |
+
"postmeta": [
|
682 |
+
{
|
683 |
+
"meta_key": {
|
684 |
+
"__prefix": "wp",
|
685 |
+
"__cdata": "layout_options"
|
686 |
+
},
|
687 |
+
"meta_value": {
|
688 |
+
"__prefix": "wp",
|
689 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/g8y89WR.png\";}"
|
690 |
+
},
|
691 |
+
"__prefix": "wp"
|
692 |
+
},
|
693 |
+
{
|
694 |
+
"meta_key": {
|
695 |
+
"__prefix": "wp",
|
696 |
+
"__cdata": "layout_elements_data"
|
697 |
+
},
|
698 |
+
"meta_value": {
|
699 |
+
"__prefix": "wp",
|
700 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:0:\"\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:11:\"auto_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:11:\"auto_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:7:\"#ffffff\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:3:\"5px\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"15\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:6:\"_blank\";s:6:\"margin\";s:4:\"10px\";s:5:\"color\";s:7:\"#ffffff\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
701 |
+
},
|
702 |
+
"__prefix": "wp"
|
703 |
+
},
|
704 |
+
{
|
705 |
+
"meta_key": {
|
706 |
+
"__prefix": "wp",
|
707 |
+
"__cdata": "custom_scripts"
|
708 |
+
},
|
709 |
+
"meta_value": {
|
710 |
+
"__prefix": "wp",
|
711 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:425:\".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;position:relative;vertical-align:top}.__ID__:hover .layer-media{z-index:9}.__ID__ .layer-media{-webkit-transition:all .4s ease 0s;transition:all .4s ease 0s;left:0;top:0;width:100%}.__ID__ .layer-content{background:rgba(0,0,0,.3) none repeat scroll 0 0;bottom:0;color:#fff;left:0;position:absolute;-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s;width:100%;}\";s:9:\"custom_js\";s:0:\"\";}"
|
712 |
+
},
|
713 |
+
"__prefix": "wp"
|
714 |
+
},
|
715 |
+
{
|
716 |
+
"meta_key": {
|
717 |
+
"__prefix": "wp",
|
718 |
+
"__cdata": "_dp_original"
|
719 |
+
},
|
720 |
+
"meta_value": {
|
721 |
+
"__prefix": "wp",
|
722 |
+
"__cdata": "51600"
|
723 |
+
},
|
724 |
+
"__prefix": "wp"
|
725 |
+
},
|
726 |
+
{
|
727 |
+
"meta_key": {
|
728 |
+
"__prefix": "wp",
|
729 |
+
"__cdata": "_edit_last"
|
730 |
+
},
|
731 |
+
"meta_value": {
|
732 |
+
"__prefix": "wp",
|
733 |
+
"__cdata": "1"
|
734 |
+
},
|
735 |
+
"__prefix": "wp"
|
736 |
+
},
|
737 |
+
{
|
738 |
+
"meta_key": {
|
739 |
+
"__prefix": "wp",
|
740 |
+
"__cdata": "_wp_old_slug"
|
741 |
+
},
|
742 |
+
"meta_value": {
|
743 |
+
"__prefix": "wp",
|
744 |
+
"__cdata": "layout-flat-2__trashed"
|
745 |
+
},
|
746 |
+
"__prefix": "wp"
|
747 |
+
}
|
748 |
+
]
|
749 |
+
},
|
750 |
+
{
|
751 |
+
"title": "Layout - Thumb Spin right",
|
752 |
+
"link": "http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat-3/",
|
753 |
+
"pubDate": "Sat, 18 Apr 2020 14:05:16 +0000",
|
754 |
+
"creator": {
|
755 |
+
"__prefix": "dc",
|
756 |
+
"__cdata": "admin"
|
757 |
+
},
|
758 |
+
"guid": {
|
759 |
+
"_isPermaLink": "false",
|
760 |
+
"__text": "http://localhost/wp/?post_type=post_grid_layout&p=51616"
|
761 |
+
},
|
762 |
+
"description": "",
|
763 |
+
"encoded": [
|
764 |
+
{
|
765 |
+
"__prefix": "content",
|
766 |
+
"__cdata": ""
|
767 |
+
},
|
768 |
+
{
|
769 |
+
"__prefix": "excerpt",
|
770 |
+
"__cdata": ""
|
771 |
+
}
|
772 |
+
],
|
773 |
+
"post_id": {
|
774 |
+
"__prefix": "wp",
|
775 |
+
"__text": "51616"
|
776 |
+
},
|
777 |
+
"post_date": {
|
778 |
+
"__prefix": "wp",
|
779 |
+
"__cdata": "2020-04-18 14:05:16"
|
780 |
+
},
|
781 |
+
"post_date_gmt": {
|
782 |
+
"__prefix": "wp",
|
783 |
+
"__cdata": "2020-04-18 14:05:16"
|
784 |
+
},
|
785 |
+
"comment_status": {
|
786 |
+
"__prefix": "wp",
|
787 |
+
"__cdata": "closed"
|
788 |
+
},
|
789 |
+
"ping_status": {
|
790 |
+
"__prefix": "wp",
|
791 |
+
"__cdata": "closed"
|
792 |
+
},
|
793 |
+
"post_name": {
|
794 |
+
"__prefix": "wp",
|
795 |
+
"__cdata": "layout-flat-3"
|
796 |
+
},
|
797 |
+
"status": {
|
798 |
+
"__prefix": "wp",
|
799 |
+
"__cdata": "publish"
|
800 |
+
},
|
801 |
+
"post_parent": {
|
802 |
+
"__prefix": "wp",
|
803 |
+
"__text": "0"
|
804 |
+
},
|
805 |
+
"menu_order": {
|
806 |
+
"__prefix": "wp",
|
807 |
+
"__text": "0"
|
808 |
+
},
|
809 |
+
"post_type": {
|
810 |
+
"__prefix": "wp",
|
811 |
+
"__cdata": "post_grid_layout"
|
812 |
+
},
|
813 |
+
"post_password": {
|
814 |
+
"__prefix": "wp",
|
815 |
+
"__cdata": ""
|
816 |
+
},
|
817 |
+
"is_sticky": {
|
818 |
+
"__prefix": "wp",
|
819 |
+
"__text": "0"
|
820 |
+
},
|
821 |
+
"postmeta": [
|
822 |
+
{
|
823 |
+
"meta_key": {
|
824 |
+
"__prefix": "wp",
|
825 |
+
"__cdata": "layout_options"
|
826 |
+
},
|
827 |
+
"meta_value": {
|
828 |
+
"__prefix": "wp",
|
829 |
+
"__cdata": "a:2:{s:17:\"preview_post_type\";s:4:\"post\";s:18:\"layout_preview_img\";s:31:\"https://i.imgur.com/OXKYCXS.gif\";}"
|
830 |
+
},
|
831 |
+
"__prefix": "wp"
|
832 |
+
},
|
833 |
+
{
|
834 |
+
"meta_key": {
|
835 |
+
"__prefix": "wp",
|
836 |
+
"__cdata": "layout_elements_data"
|
837 |
+
},
|
838 |
+
"meta_value": {
|
839 |
+
"__prefix": "wp",
|
840 |
+
"__cdata": "a:7:{s:13:\"1587187627902\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:11:\"layer-media\";s:6:\"margin\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587190790308\";a:1:{s:5:\"media\";a:6:{s:12:\"media_source\";a:4:{s:14:\"featured_image\";a:4:{s:6:\"enable\";s:3:\"yes\";s:10:\"image_size\";s:5:\"large\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"first_image\";a:3:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}s:11:\"empty_thumb\";a:4:{s:6:\"enable\";s:3:\"yes\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";s:17:\"default_thumb_src\";s:68:\"http://localhost/wp/wp-content/uploads/2020/02/long-sleeve-tee-2.jpg\";}s:22:\"siteorigin_first_image\";a:3:{s:6:\"enable\";s:2:\"no\";s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:5:\"_self\";}}s:12:\"media_height\";a:6:{s:10:\"large_type\";s:11:\"auto_height\";s:5:\"large\";s:0:\"\";s:11:\"medium_type\";s:12:\"fixed_height\";s:6:\"medium\";s:0:\"\";s:10:\"small_type\";s:10:\"max_height\";s:5:\"small\";s:0:\"\";}s:6:\"margin\";s:0:\"\";s:7:\"padding\";s:0:\"\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187640582\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}s:13:\"1587187714568\";a:1:{s:13:\"wrapper_start\";a:5:{s:10:\"wrapper_id\";s:0:\"\";s:13:\"wrapper_class\";s:13:\"layer-content\";s:6:\"margin\";s:4:\"10px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187895341\";a:1:{s:5:\"title\";a:10:{s:7:\"link_to\";s:9:\"post_link\";s:11:\"link_target\";s:6:\"_blank\";s:10:\"char_limit\";s:2:\"20\";s:5:\"color\";s:0:\"\";s:9:\"font_size\";s:4:\"18px\";s:11:\"font_family\";s:0:\"\";s:6:\"margin\";s:5:\"5px 0\";s:10:\"text_align\";s:4:\"left\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187729822\";a:1:{s:7:\"excerpt\";a:10:{s:14:\"excerpt_source\";s:15:\"excerpt_content\";s:10:\"char_limit\";s:2:\"25\";s:14:\"read_more_text\";s:9:\"Read more\";s:11:\"link_target\";s:6:\"_blank\";s:6:\"margin\";s:6:\"10px 0\";s:5:\"color\";s:0:\"\";s:10:\"text_align\";s:4:\"left\";s:9:\"font_size\";s:4:\"14px\";s:3:\"css\";s:0:\"\";s:9:\"css_hover\";s:0:\"\";}}s:13:\"1587187731727\";a:1:{s:11:\"wrapper_end\";a:1:{s:10:\"wrapper_id\";s:0:\"\";}}}"
|
841 |
+
},
|
842 |
+
"__prefix": "wp"
|
843 |
+
},
|
844 |
+
{
|
845 |
+
"meta_key": {
|
846 |
+
"__prefix": "wp",
|
847 |
+
"__cdata": "custom_scripts"
|
848 |
+
},
|
849 |
+
"meta_value": {
|
850 |
+
"__prefix": "wp",
|
851 |
+
"__cdata": "a:2:{s:10:\"custom_css\";s:526:\".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;position:relative;vertical-align:top}.__ID__:hover .layer-media{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg);opacity:0}.__ID__ .layer-media{-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s;left:0;top:0;width:100%}.__ID__:hover .layer-content{opacity:1}.__ID__ .layer-content{left:0;opacity:0;position:absolute;top:0;width:100%;-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s}.__ID__ .layer-hover{display:none}\";s:9:\"custom_js\";s:0:\"\";}"
|
852 |
+
},
|
853 |
+
"__prefix": "wp"
|
854 |
+
},
|
855 |
+
{
|
856 |
+
"meta_key": {
|
857 |
+
"__prefix": "wp",
|
858 |
+
"__cdata": "_dp_original"
|
859 |
+
},
|
860 |
+
"meta_value": {
|
861 |
+
"__prefix": "wp",
|
862 |
+
"__cdata": "51600"
|
863 |
+
},
|
864 |
+
"__prefix": "wp"
|
865 |
+
},
|
866 |
+
{
|
867 |
+
"meta_key": {
|
868 |
+
"__prefix": "wp",
|
869 |
+
"__cdata": "_edit_last"
|
870 |
+
},
|
871 |
+
"meta_value": {
|
872 |
+
"__prefix": "wp",
|
873 |
+
"__cdata": "1"
|
874 |
+
},
|
875 |
+
"__prefix": "wp"
|
876 |
+
},
|
877 |
+
{
|
878 |
+
"meta_key": {
|
879 |
+
"__prefix": "wp",
|
880 |
+
"__cdata": "_wp_old_slug"
|
881 |
+
},
|
882 |
+
"meta_value": {
|
883 |
+
"__prefix": "wp",
|
884 |
+
"__cdata": "layout-flat-3__trashed"
|
885 |
+
},
|
886 |
+
"__prefix": "wp"
|
887 |
+
}
|
888 |
+
]
|
889 |
+
}
|
890 |
+
]
|
891 |
+
},
|
892 |
+
"_xmlns:excerpt": "http://wordpress.org/export/1.2/excerpt/",
|
893 |
+
"_xmlns:content": "http://purl.org/rss/1.0/modules/content/",
|
894 |
+
"_xmlns:wfw": "http://wellformedweb.org/CommentAPI/",
|
895 |
+
"_xmlns:dc": "http://purl.org/dc/elements/1.1/",
|
896 |
+
"_xmlns:wp": "http://wordpress.org/export/1.2/",
|
897 |
+
"_version": "2.0"
|
898 |
+
}
|
899 |
+
}
|
sample-data/post-grid-layouts.xml
CHANGED
@@ -1,22 +1,4 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8" ?>
|
2 |
-
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
|
3 |
-
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
|
4 |
-
<!-- You may use this file to transfer that content from one site to another. -->
|
5 |
-
<!-- This file is not intended to serve as a complete backup of your site. -->
|
6 |
-
|
7 |
-
<!-- To import this information into a WordPress site follow these steps: -->
|
8 |
-
<!-- 1. Log in to that site as an administrator. -->
|
9 |
-
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
|
10 |
-
<!-- 3. Install the "WordPress" importer from the list. -->
|
11 |
-
<!-- 4. Activate & Run Importer. -->
|
12 |
-
<!-- 5. Upload this file using the form provided on that page. -->
|
13 |
-
<!-- 6. You will first be asked to map the authors in this export file to users -->
|
14 |
-
<!-- on the site. For each author, you may choose to map to an -->
|
15 |
-
<!-- existing user on the site or to create a new user. -->
|
16 |
-
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
|
17 |
-
<!-- contained in this file into your site. -->
|
18 |
-
|
19 |
-
<!-- generator="WordPress/5.4" created="2020-04-29 17:48" -->
|
20 |
<rss version="2.0"
|
21 |
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
|
22 |
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
@@ -26,23 +8,23 @@
|
|
26 |
>
|
27 |
|
28 |
<channel>
|
29 |
-
<title>
|
30 |
-
<link>http://localhost/wp</link>
|
31 |
-
<description>
|
32 |
-
<pubDate>
|
33 |
<language>en-US</language>
|
34 |
<wp:wxr_version>1.2</wp:wxr_version>
|
35 |
-
<wp:base_site_url>http://localhost/wp
|
36 |
-
<wp:base_blog_url>http://localhost/wp</wp:base_blog_url>
|
37 |
|
38 |
-
<wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[public.nurhasan@gmail.com]]></wp:author_email><wp:author_display_name><![CDATA[
|
39 |
|
40 |
|
41 |
<generator>https://wordpress.org/?v=5.4</generator>
|
42 |
|
43 |
<item>
|
44 |
<title>Layout - Flat</title>
|
45 |
-
<link>http://localhost/wp/post_grid_layout/layout-flat/</link>
|
46 |
<pubDate>Sat, 18 Apr 2020 05:27:40 +0000</pubDate>
|
47 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
48 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51600</guid>
|
@@ -67,20 +49,28 @@
|
|
67 |
</wp:postmeta>
|
68 |
<wp:postmeta>
|
69 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
70 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
71 |
</wp:postmeta>
|
72 |
<wp:postmeta>
|
73 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
74 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
75 |
</wp:postmeta>
|
76 |
<wp:postmeta>
|
77 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
78 |
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:94:".__ID__ a{text-decoration:none}.__ID__{vertical-align:top}.__ID__ .layer-content{padding:10px}";s:9:"custom_js";s:0:"";}]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
</wp:postmeta>
|
80 |
</item>
|
81 |
<item>
|
82 |
<title>Layout - Flip-x</title>
|
83 |
-
<link>http://localhost/wp/post_grid_layout/layout-flip-x-2/</link>
|
84 |
<pubDate>Sat, 18 Apr 2020 14:03:17 +0000</pubDate>
|
85 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
86 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51612</guid>
|
@@ -101,15 +91,15 @@
|
|
101 |
<wp:is_sticky>0</wp:is_sticky>
|
102 |
<wp:postmeta>
|
103 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
104 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
105 |
</wp:postmeta>
|
106 |
<wp:postmeta>
|
107 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
108 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
109 |
</wp:postmeta>
|
110 |
<wp:postmeta>
|
111 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
112 |
-
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:
|
113 |
</wp:postmeta>
|
114 |
<wp:postmeta>
|
115 |
<wp:meta_key><![CDATA[_dp_original]]></wp:meta_key>
|
@@ -118,11 +108,15 @@
|
|
118 |
<wp:postmeta>
|
119 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
120 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
121 |
</wp:postmeta>
|
122 |
</item>
|
123 |
<item>
|
124 |
<title>Layout - Thumb go Left</title>
|
125 |
-
<link>http://localhost/wp/post_grid_layout/layout-thumbgoleft/</link>
|
126 |
<pubDate>Sat, 18 Apr 2020 14:03:45 +0000</pubDate>
|
127 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
128 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51613</guid>
|
@@ -143,11 +137,11 @@
|
|
143 |
<wp:is_sticky>0</wp:is_sticky>
|
144 |
<wp:postmeta>
|
145 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
146 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
147 |
</wp:postmeta>
|
148 |
<wp:postmeta>
|
149 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
150 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
151 |
</wp:postmeta>
|
152 |
<wp:postmeta>
|
153 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
@@ -160,11 +154,15 @@
|
|
160 |
<wp:postmeta>
|
161 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
162 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
163 |
</wp:postmeta>
|
164 |
</item>
|
165 |
<item>
|
166 |
<title>Layout - Thumb-rounded</title>
|
167 |
-
<link>http://localhost/wp/post_grid_layout/layout-thumbrounded-2/</link>
|
168 |
<pubDate>Sat, 18 Apr 2020 14:04:05 +0000</pubDate>
|
169 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
170 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51614</guid>
|
@@ -185,11 +183,11 @@
|
|
185 |
<wp:is_sticky>0</wp:is_sticky>
|
186 |
<wp:postmeta>
|
187 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
188 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
189 |
</wp:postmeta>
|
190 |
<wp:postmeta>
|
191 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
192 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
193 |
</wp:postmeta>
|
194 |
<wp:postmeta>
|
195 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
@@ -202,11 +200,15 @@
|
|
202 |
<wp:postmeta>
|
203 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
204 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
205 |
</wp:postmeta>
|
206 |
</item>
|
207 |
<item>
|
208 |
<title>Layout - Contentbottom</title>
|
209 |
-
<link>http://localhost/wp/post_grid_layout/layout-flat-2/</link>
|
210 |
<pubDate>Sat, 18 Apr 2020 14:04:45 +0000</pubDate>
|
211 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
212 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51615</guid>
|
@@ -227,15 +229,15 @@
|
|
227 |
<wp:is_sticky>0</wp:is_sticky>
|
228 |
<wp:postmeta>
|
229 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
230 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
231 |
</wp:postmeta>
|
232 |
<wp:postmeta>
|
233 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
234 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
235 |
</wp:postmeta>
|
236 |
<wp:postmeta>
|
237 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
238 |
-
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:
|
239 |
</wp:postmeta>
|
240 |
<wp:postmeta>
|
241 |
<wp:meta_key><![CDATA[_dp_original]]></wp:meta_key>
|
@@ -244,11 +246,15 @@
|
|
244 |
<wp:postmeta>
|
245 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
246 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
247 |
</wp:postmeta>
|
248 |
</item>
|
249 |
<item>
|
250 |
<title>Layout - Thumb Spin right</title>
|
251 |
-
<link>http://localhost/wp/post_grid_layout/layout-flat-3/</link>
|
252 |
<pubDate>Sat, 18 Apr 2020 14:05:16 +0000</pubDate>
|
253 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
254 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51616</guid>
|
@@ -269,11 +275,11 @@
|
|
269 |
<wp:is_sticky>0</wp:is_sticky>
|
270 |
<wp:postmeta>
|
271 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
272 |
-
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:
|
273 |
</wp:postmeta>
|
274 |
<wp:postmeta>
|
275 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
276 |
-
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:
|
277 |
</wp:postmeta>
|
278 |
<wp:postmeta>
|
279 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
@@ -286,6 +292,10 @@
|
|
286 |
<wp:postmeta>
|
287 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
288 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
|
|
|
|
|
|
|
|
289 |
</wp:postmeta>
|
290 |
</item>
|
291 |
</channel>
|
1 |
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<rss version="2.0"
|
3 |
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
|
4 |
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
8 |
>
|
9 |
|
10 |
<channel>
|
11 |
+
<title>Post Grid</title>
|
12 |
+
<link>http://localhost/wp-multi/post-grid</link>
|
13 |
+
<description>Just another WordPress Multi Sites site</description>
|
14 |
+
<pubDate>Thu, 28 May 2020 16:16:28 +0000</pubDate>
|
15 |
<language>en-US</language>
|
16 |
<wp:wxr_version>1.2</wp:wxr_version>
|
17 |
+
<wp:base_site_url>http://localhost/wp-multi/</wp:base_site_url>
|
18 |
+
<wp:base_blog_url>http://localhost/wp-multi/post-grid</wp:base_blog_url>
|
19 |
|
20 |
+
<wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[public.nurhasan@gmail.com]]></wp:author_email><wp:author_display_name><![CDATA[]]></wp:author_display_name><wp:author_first_name><![CDATA[Nur]]></wp:author_first_name><wp:author_last_name><![CDATA[Hasan]]></wp:author_last_name></wp:author>
|
21 |
|
22 |
|
23 |
<generator>https://wordpress.org/?v=5.4</generator>
|
24 |
|
25 |
<item>
|
26 |
<title>Layout - Flat</title>
|
27 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat/</link>
|
28 |
<pubDate>Sat, 18 Apr 2020 05:27:40 +0000</pubDate>
|
29 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
30 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51600</guid>
|
49 |
</wp:postmeta>
|
50 |
<wp:postmeta>
|
51 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
52 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/p0wi9sx.png";}]]></wp:meta_value>
|
53 |
</wp:postmeta>
|
54 |
<wp:postmeta>
|
55 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
56 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:59:"http://localhost/wp/wp-content/uploads/2020/02/single-1.jpg";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:4:"none";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:11:"auto_height";s:6:"medium";s:0:"";s:10:"small_type";s:11:"auto_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:0:"";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:5:"5px 0";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"20";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:5:"_self";s:6:"margin";s:5:"0px 0";s:5:"color";s:0:"";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
57 |
</wp:postmeta>
|
58 |
<wp:postmeta>
|
59 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
60 |
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:94:".__ID__ a{text-decoration:none}.__ID__{vertical-align:top}.__ID__ .layer-content{padding:10px}";s:9:"custom_js";s:0:"";}]]></wp:meta_value>
|
61 |
+
</wp:postmeta>
|
62 |
+
<wp:postmeta>
|
63 |
+
<wp:meta_key><![CDATA[post_grid_post_settings]]></wp:meta_key>
|
64 |
+
<wp:meta_value><![CDATA[a:14:{s:19:"custom_thumb_source";s:91:"http://localhost/wp/wp-content/plugins/post-grid/assets/frontend/css/images/placeholder.png";s:16:"thumb_custom_url";s:0:"";s:9:"layout_id";s:5:"51600";s:17:"font_awesome_icon";s:0:"";s:23:"font_awesome_icon_color";s:0:"";s:22:"font_awesome_icon_size";s:0:"";s:17:"custom_youtube_id";s:0:"";s:15:"custom_vimeo_id";s:0:"";s:21:"custom_dailymotion_id";s:0:"";s:14:"custom_mp3_url";s:0:"";s:20:"custom_soundcloud_id";s:0:"";s:16:"custom_video_MP4";s:0:"";s:16:"custom_video_OGV";s:0:"";s:17:"custom_video_WEBM";s:0:"";}]]></wp:meta_value>
|
65 |
+
</wp:postmeta>
|
66 |
+
<wp:postmeta>
|
67 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
68 |
+
<wp:meta_value><![CDATA[layout-flat__trashed]]></wp:meta_value>
|
69 |
</wp:postmeta>
|
70 |
</item>
|
71 |
<item>
|
72 |
<title>Layout - Flip-x</title>
|
73 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-flip-x-2/</link>
|
74 |
<pubDate>Sat, 18 Apr 2020 14:03:17 +0000</pubDate>
|
75 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
76 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51612</guid>
|
91 |
<wp:is_sticky>0</wp:is_sticky>
|
92 |
<wp:postmeta>
|
93 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
94 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/Yk1lKJw.gif";}]]></wp:meta_value>
|
95 |
</wp:postmeta>
|
96 |
<wp:postmeta>
|
97 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
98 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:0:"";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:11:"auto_height";s:6:"medium";s:0:"";s:10:"small_type";s:11:"auto_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:3:"0px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:0:"";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:5:"5px 0";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"25";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:6:"_blank";s:6:"margin";s:6:"10px 0";s:5:"color";s:0:"";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
99 |
</wp:postmeta>
|
100 |
<wp:postmeta>
|
101 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
102 |
+
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:1285:".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;padding:0;-webkit-perspective:600px;perspective:600px;position:relative;vertical-align:top;width:100%}.__ID__:hover .layer-media{background:#fff none repeat scroll 0 0;-webkit-transform:rotateX(180deg);transform:rotateX(180deg);z-index:900}.__ID__ .layer-media{-webkit-backface-visibility:hidden;backface-visibility:hidden;background:#fff none repeat scroll 0 0;float:none;height:inherit;left:0;text-align:center;top:0;-webkit-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition:all .4s ease-in-out 0s;transition:all .4s ease-in-out 0s;width:inherit;z-index:900}.__ID__:hover .layer-content{background:#fff none repeat scroll 0 0;-webkit-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0);z-index:1000}.__ID__ .layer-content{-webkit-backface-visibility:hidden;backface-visibility:hidden;background:#fff none repeat scroll 0 0;float:none;height:inherit;left:0;padding:0;position:absolute;top:0;-webkit-transform:rotateX(-179deg);transform:rotateX(-179deg);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition:all .4s ease-in-out 0s;transition:all .4s ease-in-out 0s;width:inherit;z-index:800;}";s:9:"custom_js";s:0:"";}]]></wp:meta_value>
|
103 |
</wp:postmeta>
|
104 |
<wp:postmeta>
|
105 |
<wp:meta_key><![CDATA[_dp_original]]></wp:meta_key>
|
108 |
<wp:postmeta>
|
109 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
110 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
111 |
+
</wp:postmeta>
|
112 |
+
<wp:postmeta>
|
113 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
114 |
+
<wp:meta_value><![CDATA[layout-flip-x-2__trashed]]></wp:meta_value>
|
115 |
</wp:postmeta>
|
116 |
</item>
|
117 |
<item>
|
118 |
<title>Layout - Thumb go Left</title>
|
119 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-thumbgoleft/</link>
|
120 |
<pubDate>Sat, 18 Apr 2020 14:03:45 +0000</pubDate>
|
121 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
122 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51613</guid>
|
137 |
<wp:is_sticky>0</wp:is_sticky>
|
138 |
<wp:postmeta>
|
139 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
140 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/V4ADgV7.gif";}]]></wp:meta_value>
|
141 |
</wp:postmeta>
|
142 |
<wp:postmeta>
|
143 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
144 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:0:"";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:11:"auto_height";s:6:"medium";s:0:"";s:10:"small_type";s:11:"auto_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:4:"10px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:0:"";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:5:"5px 0";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"20";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:6:"_blank";s:6:"margin";s:6:"10px 0";s:5:"color";s:0:"";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
145 |
</wp:postmeta>
|
146 |
<wp:postmeta>
|
147 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
154 |
<wp:postmeta>
|
155 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
156 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
157 |
+
</wp:postmeta>
|
158 |
+
<wp:postmeta>
|
159 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
160 |
+
<wp:meta_value><![CDATA[layout-thumbgoleft__trashed]]></wp:meta_value>
|
161 |
</wp:postmeta>
|
162 |
</item>
|
163 |
<item>
|
164 |
<title>Layout - Thumb-rounded</title>
|
165 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-thumbrounded-2/</link>
|
166 |
<pubDate>Sat, 18 Apr 2020 14:04:05 +0000</pubDate>
|
167 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
168 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51614</guid>
|
183 |
<wp:is_sticky>0</wp:is_sticky>
|
184 |
<wp:postmeta>
|
185 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
186 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/X9WRLgA.png";}]]></wp:meta_value>
|
187 |
</wp:postmeta>
|
188 |
<wp:postmeta>
|
189 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
190 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:0:"";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:11:"auto_height";s:6:"medium";s:0:"";s:10:"small_type";s:11:"auto_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:4:"10px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:0:"";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:5:"5px 0";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"20";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:6:"_blank";s:6:"margin";s:6:"10px 0";s:5:"color";s:0:"";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
191 |
</wp:postmeta>
|
192 |
<wp:postmeta>
|
193 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
200 |
<wp:postmeta>
|
201 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
202 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
203 |
+
</wp:postmeta>
|
204 |
+
<wp:postmeta>
|
205 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
206 |
+
<wp:meta_value><![CDATA[layout-thumbrounded-2__trashed]]></wp:meta_value>
|
207 |
</wp:postmeta>
|
208 |
</item>
|
209 |
<item>
|
210 |
<title>Layout - Contentbottom</title>
|
211 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat-2/</link>
|
212 |
<pubDate>Sat, 18 Apr 2020 14:04:45 +0000</pubDate>
|
213 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
214 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51615</guid>
|
229 |
<wp:is_sticky>0</wp:is_sticky>
|
230 |
<wp:postmeta>
|
231 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
232 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/g8y89WR.png";}]]></wp:meta_value>
|
233 |
</wp:postmeta>
|
234 |
<wp:postmeta>
|
235 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
236 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:0:"";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:11:"auto_height";s:6:"medium";s:0:"";s:10:"small_type";s:11:"auto_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:7:"#ffffff";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:3:"5px";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"15";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:6:"_blank";s:6:"margin";s:4:"10px";s:5:"color";s:7:"#ffffff";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
237 |
</wp:postmeta>
|
238 |
<wp:postmeta>
|
239 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
240 |
+
<wp:meta_value><![CDATA[a:2:{s:10:"custom_css";s:425:".__ID__ a{text-decoration:none}.__ID__{overflow:hidden;position:relative;vertical-align:top}.__ID__:hover .layer-media{z-index:9}.__ID__ .layer-media{-webkit-transition:all .4s ease 0s;transition:all .4s ease 0s;left:0;top:0;width:100%}.__ID__ .layer-content{background:rgba(0,0,0,.3) none repeat scroll 0 0;bottom:0;color:#fff;left:0;position:absolute;-webkit-transition:all 1s ease 0s;transition:all 1s ease 0s;width:100%;}";s:9:"custom_js";s:0:"";}]]></wp:meta_value>
|
241 |
</wp:postmeta>
|
242 |
<wp:postmeta>
|
243 |
<wp:meta_key><![CDATA[_dp_original]]></wp:meta_key>
|
246 |
<wp:postmeta>
|
247 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
248 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
249 |
+
</wp:postmeta>
|
250 |
+
<wp:postmeta>
|
251 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
252 |
+
<wp:meta_value><![CDATA[layout-flat-2__trashed]]></wp:meta_value>
|
253 |
</wp:postmeta>
|
254 |
</item>
|
255 |
<item>
|
256 |
<title>Layout - Thumb Spin right</title>
|
257 |
+
<link>http://localhost/wp-multi/post-grid/post_grid_layout/layout-flat-3/</link>
|
258 |
<pubDate>Sat, 18 Apr 2020 14:05:16 +0000</pubDate>
|
259 |
<dc:creator><![CDATA[admin]]></dc:creator>
|
260 |
<guid isPermaLink="false">http://localhost/wp/?post_type=post_grid_layout&p=51616</guid>
|
275 |
<wp:is_sticky>0</wp:is_sticky>
|
276 |
<wp:postmeta>
|
277 |
<wp:meta_key><![CDATA[layout_options]]></wp:meta_key>
|
278 |
+
<wp:meta_value><![CDATA[a:2:{s:17:"preview_post_type";s:4:"post";s:18:"layout_preview_img";s:31:"https://i.imgur.com/OXKYCXS.gif";}]]></wp:meta_value>
|
279 |
</wp:postmeta>
|
280 |
<wp:postmeta>
|
281 |
<wp:meta_key><![CDATA[layout_elements_data]]></wp:meta_key>
|
282 |
+
<wp:meta_value><![CDATA[a:7:{s:13:"1587187627902";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:11:"layer-media";s:6:"margin";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587190790308";a:1:{s:5:"media";a:6:{s:12:"media_source";a:4:{s:14:"featured_image";a:4:{s:6:"enable";s:3:"yes";s:10:"image_size";s:5:"large";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"first_image";a:3:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}s:11:"empty_thumb";a:4:{s:6:"enable";s:3:"yes";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";s:17:"default_thumb_src";s:68:"http://localhost/wp/wp-content/uploads/2020/02/long-sleeve-tee-2.jpg";}s:22:"siteorigin_first_image";a:3:{s:6:"enable";s:2:"no";s:7:"link_to";s:9:"post_link";s:11:"link_target";s:5:"_self";}}s:12:"media_height";a:6:{s:10:"large_type";s:11:"auto_height";s:5:"large";s:0:"";s:11:"medium_type";s:12:"fixed_height";s:6:"medium";s:0:"";s:10:"small_type";s:10:"max_height";s:5:"small";s:0:"";}s:6:"margin";s:0:"";s:7:"padding";s:0:"";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187640582";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}s:13:"1587187714568";a:1:{s:13:"wrapper_start";a:5:{s:10:"wrapper_id";s:0:"";s:13:"wrapper_class";s:13:"layer-content";s:6:"margin";s:4:"10px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187895341";a:1:{s:5:"title";a:10:{s:7:"link_to";s:9:"post_link";s:11:"link_target";s:6:"_blank";s:10:"char_limit";s:2:"20";s:5:"color";s:0:"";s:9:"font_size";s:4:"18px";s:11:"font_family";s:0:"";s:6:"margin";s:5:"5px 0";s:10:"text_align";s:4:"left";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187729822";a:1:{s:7:"excerpt";a:10:{s:14:"excerpt_source";s:15:"excerpt_content";s:10:"char_limit";s:2:"25";s:14:"read_more_text";s:9:"Read more";s:11:"link_target";s:6:"_blank";s:6:"margin";s:6:"10px 0";s:5:"color";s:0:"";s:10:"text_align";s:4:"left";s:9:"font_size";s:4:"14px";s:3:"css";s:0:"";s:9:"css_hover";s:0:"";}}s:13:"1587187731727";a:1:{s:11:"wrapper_end";a:1:{s:10:"wrapper_id";s:0:"";}}}]]></wp:meta_value>
|
283 |
</wp:postmeta>
|
284 |
<wp:postmeta>
|
285 |
<wp:meta_key><![CDATA[custom_scripts]]></wp:meta_key>
|
292 |
<wp:postmeta>
|
293 |
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
|
294 |
<wp:meta_value><![CDATA[1]]></wp:meta_value>
|
295 |
+
</wp:postmeta>
|
296 |
+
<wp:postmeta>
|
297 |
+
<wp:meta_key><![CDATA[_wp_old_slug]]></wp:meta_key>
|
298 |
+
<wp:meta_value><![CDATA[layout-flat-3__trashed]]></wp:meta_value>
|
299 |
</wp:postmeta>
|
300 |
</item>
|
301 |
</channel>
|
templates/post-grid-hook.php
CHANGED
@@ -20,7 +20,6 @@ function post_grid_main_lazy($atts){
|
|
20 |
?>
|
21 |
<div id="post-grid-lazy-<?php echo $grid_id; ?>" class="post-grid-lazy"><img src="<?php echo $lazy_load_image_src; ?>"/></div>
|
22 |
<script>
|
23 |
-
|
24 |
jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
|
25 |
jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').fadeOut();
|
26 |
jQuery('#post-grid-<?php echo $grid_id; ?>').fadeIn();
|
@@ -1089,48 +1088,34 @@ function post_grid_main_scripts($args){
|
|
1089 |
?>
|
1090 |
</style>
|
1091 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
1092 |
|
|
|
1093 |
|
1094 |
-
|
1095 |
-
<?php
|
1096 |
-
if(!empty($custom_js)): ?>
|
1097 |
-
<?php echo $custom_js; ?>
|
1098 |
-
<?php
|
1099 |
-
endif;
|
1100 |
?>
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
$container.imagesLoaded().done( function() {
|
1117 |
-
$container.masonry('layout');
|
1118 |
-
});
|
1119 |
-
})
|
1120 |
-
<?php endif; ?>
|
1121 |
-
|
1122 |
-
</script>
|
1123 |
-
|
1124 |
<?php
|
1125 |
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
// layout custom css
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
}
|
1135 |
|
1136 |
|
20 |
?>
|
21 |
<div id="post-grid-lazy-<?php echo $grid_id; ?>" class="post-grid-lazy"><img src="<?php echo $lazy_load_image_src; ?>"/></div>
|
22 |
<script>
|
|
|
23 |
jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
|
24 |
jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').fadeOut();
|
25 |
jQuery('#post-grid-<?php echo $grid_id; ?>').fadeIn();
|
1088 |
?>
|
1089 |
</style>
|
1090 |
<?php endif; ?>
|
1091 |
+
<script>
|
1092 |
+
<?php
|
1093 |
+
if(!empty($custom_js)): ?>
|
1094 |
+
<?php echo $custom_js; ?>
|
1095 |
+
<?php
|
1096 |
+
endif;
|
1097 |
|
1098 |
+
$masonry_load = apply_filters('post_grid_masonry_load', true, $args);
|
1099 |
|
1100 |
+
if($masonry_enable=='yes' && $masonry_load == true ):
|
|
|
|
|
|
|
|
|
|
|
1101 |
?>
|
1102 |
+
jQuery('#post-grid-lazy-<?php echo $grid_id; ?>').ready(function($){
|
1103 |
+
var $container = $('#post-grid-<?php echo $grid_id; ?> .grid-items');
|
1104 |
+
$container.masonry({
|
1105 |
+
itemSelector: '.item',
|
1106 |
+
columnWidth: '.item', //as you wish , you can use numeric
|
1107 |
+
isAnimated: true,
|
1108 |
+
isFitWidth: true,
|
1109 |
+
horizontalOrder: true,
|
1110 |
+
});
|
1111 |
+
$container.imagesLoaded().done( function() {
|
1112 |
+
$container.masonry('layout');
|
1113 |
+
});
|
1114 |
+
})
|
1115 |
+
<?php endif; ?>
|
1116 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
<?php
|
1118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1119 |
}
|
1120 |
|
1121 |
|
templates/single/single-template-hook.php
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
-
|
4 |
-
|
5 |
-
get_header();
|
6 |
-
|
7 |
-
?>
|
8 |
-
|
9 |
-
<?php
|
10 |
-
|
11 |
-
$post_id = get_the_id();
|
12 |
-
$post_grid_post_settings = get_post_meta($post_id,'post_grid_post_settings', true);
|
13 |
-
|
14 |
-
$layout_id = !empty($post_grid_post_settings['layout_id']) ? (int) $post_grid_post_settings['layout_id'] : '51851';
|
15 |
-
|
16 |
-
//var_dump($layout_id);
|
17 |
-
|
18 |
-
if(!empty($layout_id)){
|
19 |
-
|
20 |
-
|
21 |
-
$layout_elements_data = get_post_meta( $layout_id, 'layout_elements_data', true );
|
22 |
-
$layout_custom_scripts = get_post_meta($layout_id,'custom_scripts', true);
|
23 |
-
$layout_custom_css = isset($layout_custom_scripts['custom_css']) ? $layout_custom_scripts['custom_css'] : '';
|
24 |
-
|
25 |
-
ob_start();
|
26 |
-
|
27 |
-
?>
|
28 |
-
<div class="layout-<?php echo $layout_id; ?>">
|
29 |
-
<?php
|
30 |
-
|
31 |
-
if(!empty($layout_elements_data))
|
32 |
-
foreach($layout_elements_data as $elementIndex=>$elementData){
|
33 |
-
foreach($elementData as $elementId=>$element) {
|
34 |
-
|
35 |
-
//var_dump($elementId);
|
36 |
-
|
37 |
-
$element_args['element'] = $element;
|
38 |
-
$element_args['index'] = $elementIndex;
|
39 |
-
|
40 |
-
$element_args['post_id'] = $post_id;
|
41 |
-
$element_args['layout_id'] = $layout_id;
|
42 |
-
|
43 |
-
do_action('post_grid_layout_element_' . $elementId, $element_args);
|
44 |
-
do_action('post_grid_layout_element_css_' . $elementId, $element_args);
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
51 |
-
?>
|
52 |
-
</div>
|
53 |
-
<?php if(!empty($layout_custom_css)): ?>
|
54 |
-
<style type="text/css">
|
55 |
-
<?php
|
56 |
-
echo str_replace('__ID__', 'layout-'.$layout_id, $layout_custom_css);
|
57 |
-
?>
|
58 |
-
</style>
|
59 |
-
<?php endif; ?>
|
60 |
-
<?php
|
61 |
-
$content = ob_get_clean();
|
62 |
-
|
63 |
-
echo $content;
|
64 |
-
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
?>
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
<?php
|
73 |
-
|
74 |
-
get_footer();
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|