Changeset 3033309
- Timestamp:
- 02/08/2024 04:58:06 PM (2 years ago)
- Location:
- sided
- Files:
-
- 33 added
- 4 edited
-
tags/1.3.3/admin (added)
-
tags/1.3.3/admin/css (added)
-
tags/1.3.3/admin/css/blockstyles.css (added)
-
tags/1.3.3/admin/css/styles.css (added)
-
tags/1.3.3/admin/css/styles.scss (added)
-
tags/1.3.3/assets/js (added)
-
tags/1.3.3/assets/js/daterangepicker.min.js (added)
-
tags/1.3.3/assets/js/jquery.simplePagination.min.js (added)
-
tags/1.3.3/assets/js/jquery.validate.min.js (added)
-
tags/1.3.3/env.php (added)
-
tags/1.3.3/includes (added)
-
tags/1.3.3/includes/block-editor (added)
-
tags/1.3.3/includes/block-editor/index.js (added)
-
tags/1.3.3/includes/block-editor/index.jsx (added)
-
tags/1.3.3/includes/block-editor/sided-block-editor.php (added)
-
tags/1.3.3/partials (added)
-
tags/1.3.3/partials/functions.php (added)
-
tags/1.3.3/partials/includes (added)
-
tags/1.3.3/partials/includes/imgs (added)
-
tags/1.3.3/partials/includes/imgs/sided_favicon.jpg (added)
-
tags/1.3.3/partials/includes/sided-authenticate-apikey.php (added)
-
tags/1.3.3/partials/includes/sided-common-header.php (added)
-
tags/1.3.3/partials/includes/sided-settings-header.php (added)
-
tags/1.3.3/partials/sided-create-debate-from-block.php (added)
-
tags/1.3.3/partials/sided-create-debate.php (added)
-
tags/1.3.3/partials/sided-dashboard.php (added)
-
tags/1.3.3/partials/sided-debates.php (added)
-
tags/1.3.3/partials/sided-edit-debate.php (added)
-
tags/1.3.3/partials/sided-edit-draft.php (added)
-
tags/1.3.3/partials/sided-settings.php (added)
-
tags/1.3.3/partials/sided-shortcode-to-embed.php (added)
-
tags/1.3.3/readme.txt (added)
-
tags/1.3.3/sided.php (added)
-
trunk/partials/functions.php (modified) (2 diffs)
-
trunk/partials/sided-settings.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sided.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sided/trunk/partials/functions.php
r3006142 r3033309 77 77 } 78 78 79 function add_send_cat_script() {79 function add_send_cat_script() { 80 80 $send_cats_to_sided = get_option('send_cats_to_sided'); 81 if ($send_cats_to_sided == 'true' && (is_single() || is_page())) { 82 $categories = get_the_category(); 83 84 $category_names = array(); 85 foreach ($categories as $category) { 86 $category_names[] = $category->name; 87 } 88 if(count($category_names) > 0){ 81 $send_tags_to_sided = get_option('send_tags_to_sided'); 82 83 if (($send_cats_to_sided == 'true' || $send_tags_to_sided == 'true') && (is_single() || is_page())) { 84 $names = []; 85 86 if ($send_cats_to_sided == 'true') { 87 $categories = get_the_category(); 88 foreach ($categories as $category) { 89 $names[] = $category->name; 90 } 91 } 92 93 if ($send_tags_to_sided == 'true') { 94 $tags = get_the_tags(); 95 foreach ($tags as $tag) { 96 $names[] = $tag->name; 97 } 98 } 99 100 if (count($names) > 0) { 89 101 echo "<script> 90 console.log('send_cats_to_sided');91 102 window.sidedScriptPayload = window.sidedScriptPayload || {}; 92 window.sidedScriptPayload.categories = ['" . implode("', '", $ category_names) . "'];103 window.sidedScriptPayload.categories = ['" . implode("', '", $names) . "']; 93 104 </script>"; 94 105 } … … 111 122 { 112 123 echo update_option('send_cats_to_sided', sanitize_text_field($_POST['checked'])); 124 wp_die(); 125 } 126 127 add_action('wp_ajax_wpa_send_tags_to_sided', 'sided_wpa_send_tags_to_sided_callback'); 128 add_action('wp_ajax_nopriv_wpa_send_tags_to_sided', 'sided_wpa_send_tags_to_sided_callback'); 129 function sided_wpa_send_tags_to_sided_callback() 130 { 131 echo update_option('send_tags_to_sided', sanitize_text_field($_POST['checked'])); 113 132 wp_die(); 114 133 } -
sided/trunk/partials/sided-settings.php
r3029321 r3033309 21 21 delete_option('sided_sided_embed_placement_options'); 22 22 delete_option('send_cats_to_sided'); 23 delete_option('send_tags_to_sided'); 23 24 } 24 25 25 26 $sided_initiate_script = get_option('sided_sided_initiate_script'); 26 27 $send_cats_to_sided = get_option('send_cats_to_sided'); 28 $send_tags_to_sided = get_option('send_tags_to_sided'); 27 29 28 30 include 'includes/sided-authenticate-apikey.php'; … … 79 81 <?php if($status_aat === 'Valid Token'){ ?> 80 82 <hr/> 81 <div class="wrap one-click-integration common-form ">83 <div class="wrap one-click-integration common-form"> 82 84 <label>One Click Integration</label> 83 85 … … 100 102 101 103 <label class="mt-3">Match polls by post category</label> 102 <label class="mb-3 mt-2"><input type="checkbox" <?php if($send_cats_to_sided == 'true') { echo 'checked'; } ?> name="send_cats_to_sided"><span class="fadedSpan"> Send categories to Sided.</span></label> 103 104 <label class="mb-3 mt-2"> 105 <input type="checkbox" <?php if ($send_cats_to_sided == 'true') { echo 'checked'; } ?> name="send_cats_to_sided"> 106 <span class="fadedSpan"> Send categories to Sided</span> 107 </label> 108 <label class="mb-3 mt-2"> 109 <input type="checkbox" <?php if ($send_tags_to_sided == 'true') { echo 'checked'; } ?> name="send_tags_to_sided"> 110 <span class="fadedSpan"> Send tags to Sided</span> 111 </label> 104 112 </div> 105 113 <?php } ?> … … 128 136 var data = { 129 137 action: 'wpa_send_cats_to_sided', 138 checked: $(this).is(":checked") ? true : false, 139 }; 140 jQuery.post( ajaxurl, data, function(response) { 141 console.log(response); 142 }); 143 }); 144 145 $('input[name="send_tags_to_sided"]').change(function() { 146 var data = { 147 action: 'wpa_send_tags_to_sided', 130 148 checked: $(this).is(":checked") ? true : false, 131 149 }; -
sided/trunk/readme.txt
r3029321 r3033309 5 5 Requires at least: 4.7 6 6 Tested up to: 6.2 7 Stable tag: 1.3. 27 Stable tag: 1.3.3 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 38 38 39 39 == Changelog == 40 = 1.3.3 = 41 * Send tags to Sided 42 40 43 = 1.3.2 = 41 44 * Optimizations -
sided/trunk/sided.php
r3029321 r3033309 4 4 * Plugin URI: https://sided.co/ 5 5 * Description: It is a wordpress plugin to embed sided polls in your Wordpress website. 6 * Version: 1.3. 26 * Version: 1.3.3 7 7 * Author: Sided 8 8 **/ 9 9 10 define( 'SIDED_VERSION', '1.3. 2' );10 define( 'SIDED_VERSION', '1.3.3' ); 11 11 define( 'SIDED_PLUGIN', __FILE__ ); 12 12 define( 'SIDED_PLUGIN_DIR', untrailingslashit( dirname( SIDED_PLUGIN ) ) );
Note: See TracChangeset
for help on using the changeset viewer.