Changeset 2390989
- Timestamp:
- 09/30/2020 02:18:28 PM (5 years ago)
- Location:
- hqtheme-extra
- Files:
-
- 16 edited
- 1 copied
-
tags/1.0.2 (copied) (copied from hqtheme-extra/trunk)
-
tags/1.0.2/hqtheme-extra.php (modified) (2 diffs)
-
tags/1.0.2/inc/demos/import-log.php (modified) (1 diff)
-
tags/1.0.2/inc/dependencies.php (modified) (1 diff)
-
tags/1.0.2/inc/hqlib/field/base.php (modified) (1 diff)
-
tags/1.0.2/inc/hqlib/helper.php (modified) (1 diff)
-
tags/1.0.2/inc/hqlib/hqlib.php (modified) (3 diffs)
-
tags/1.0.2/inc/hqlib/utils.php (modified) (1 diff)
-
tags/1.0.2/readme.txt (modified) (3 diffs)
-
trunk/hqtheme-extra.php (modified) (2 diffs)
-
trunk/inc/demos/import-log.php (modified) (1 diff)
-
trunk/inc/dependencies.php (modified) (1 diff)
-
trunk/inc/hqlib/field/base.php (modified) (1 diff)
-
trunk/inc/hqlib/helper.php (modified) (1 diff)
-
trunk/inc/hqlib/hqlib.php (modified) (3 diffs)
-
trunk/inc/hqlib/utils.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hqtheme-extra/tags/1.0.2/hqtheme-extra.php
r2387736 r2390989 5 5 * Plugin URI: https://hqtheme.net/hqtheme/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=plugin-uri 6 6 * Description: HQTheme Extra adds extras for HQTheme - Ready sites one click import 7 * Version: 1.0. 17 * Version: 1.0.2 8 8 * Requires at least: 5.3 9 9 * Requires PHP: 7.2 … … 57 57 * @var string 58 58 */ 59 const VERSION = '1.0. 1';59 const VERSION = '1.0.2'; 60 60 61 61 // Load Autoloader -
hqtheme-extra/tags/1.0.2/inc/demos/import-log.php
r2387081 r2390989 50 50 // Get user credentials for WP file-system API. 51 51 $import = wp_nonce_url(admin_url('themes.php?page=hqtheme-ready-sites'), 'hqt-import'); 52 $creds = request_filesystem_credentials($import, '', false, false, null);52 $creds = \request_filesystem_credentials($import, '', false, false, null); 53 53 if (false === $creds) { 54 54 return; -
hqtheme-extra/tags/1.0.2/inc/dependencies.php
r2387736 r2390989 69 69 $install_url = wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $theme_wordpress_repo_slug), 'install-theme_' . $theme_wordpress_repo_slug); 70 70 $message = '<h3>' . $required_recommended . ' Theme - HQTheme</h3>' 71 . '<p>' . sprintf(_x('<b>%s</b> works best with <b>%s</b>. That\'s why we recommed <a href="%s" target="_blank">%s</a>. <br>Learn more about HQTheme <a href="%s" target="_blank" >here</a>.', 'theme dependency', 'hqtheme-e nhancer-pro'), $this->currnet_plugin_name, 'HQTheme', $theme_details_link, 'HQTheme', $theme_details_link) . '</p>';72 $message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s %s</a>', $install_url, _x('Install', 'theme dependency', 'hqtheme-e nhancer-pro'), 'HQTheme') . '</p>';71 . '<p>' . sprintf(_x('<b>%s</b> works best with <b>%s</b>. That\'s why we recommed <a href="%s" target="_blank">%s</a>. <br>Learn more about HQTheme <a href="%s" target="_blank" >here</a>.', 'theme dependency', 'hqtheme-extra'), $this->currnet_plugin_name, 'HQTheme', $theme_details_link, 'HQTheme', $theme_details_link) . '</p>'; 72 $message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s %s</a>', $install_url, _x('Install', 'theme dependency', 'hqtheme-extra'), 'HQTheme') . '</p>'; 73 73 Admin_Notifications::instance()->add_notice('theme-install', 'info', $message, $allow_dismis); 74 74 } -
hqtheme-extra/tags/1.0.2/inc/hqlib/field/base.php
r2387736 r2390989 262 262 $data = \HQLib\hq_get_option($field_id, '', $this->default_value, 'theme_mods', false); 263 263 } else if ('post_meta' === $storage) { 264 $data = \HQLib\get_post_meta($field_id, '', $this->default_value, false); 264 $post_id = get_the_ID(); 265 $data = \HQLib\get_post_meta($post_id, $field_id, '', $this->default_value, false); 265 266 } else if ('tax_meta' === $storage) { 266 267 $term_id = isset($_REQUEST['tag_ID']) ? sanitize_key($_REQUEST['tag_ID']) : false; -
hqtheme-extra/tags/1.0.2/inc/hqlib/helper.php
r2387081 r2390989 206 206 foreach ($terms as $term) { 207 207 $result[] = [ 208 'value' => $term-> slug,208 'value' => $term->term_id, 209 209 'label' => $term->name, 210 210 ]; -
hqtheme-extra/tags/1.0.2/inc/hqlib/hqlib.php
r2387736 r2390989 120 120 * @return any 121 121 */ 122 function get_post_meta($key = null, $group = null, $default = false, $add_prefix = true) { 123 global $post; 124 125 if (!$post->ID) { 126 return $default; 122 function get_post_meta($post_id = null, $key = null, $group = null, $default = false, $add_prefix = true) { 123 if (!$post_id) { 124 global $post; 125 126 if (!$post->ID) { 127 return $default; 128 } 129 $post_id = $post->ID; 127 130 } 128 131 129 132 if ($group) { 130 133 $group = \HQLib\HQLIB_PREFIX . $group; 131 $options = \get_post_meta($post ->ID, $group, false);134 $options = \get_post_meta($post_id, $group, false); 132 135 if (empty($key)) { 133 136 return $options; … … 137 140 $key = empty($key) ? '' : \HQLib\HQLIB_PREFIX . $key; 138 141 } 139 return \get_post_meta($post ->ID, $key, true);142 return \get_post_meta($post_id, $key, true); 140 143 } 141 144 … … 182 185 183 186 /** 187 * Get terms objects list 188 * 189 * @param [type] $taxonomy 190 * @param boolean $child_of_current 191 * @return [type] 192 */ 193 function get_terms_objects($taxonomy = null, $child_of_current = false, $custom_args = array()) { 194 195 if (!$taxonomy) { 196 return array(); 197 } 198 199 if (!is_array($custom_args)) { 200 $custom_args = array(); 201 } 202 203 $args = array_merge(array('taxonomy' => $taxonomy), $custom_args); 204 205 if ($child_of_current && is_tax($taxonomy)) { 206 $args['child_of'] = get_queried_object_id(); 207 } 208 209 return \get_terms($args); 210 } 211 212 /** 213 * Get terms of passed taxonomy for options list 214 * 215 * @param [type] $taxonomy 216 * @param boolean $child_of_current 217 * @return [type] 218 */ 219 function get_terms_for_options($taxonomy = null, $child_of_current = false, $custom_args = array()) { 220 221 $terms = \HQLib\get_terms_objects($taxonomy, $child_of_current, $custom_args); 222 return wp_list_pluck($terms, 'name', 'term_id'); 223 } 224 225 /** 184 226 * Get global option 185 227 * @param string $key -
hqtheme-extra/tags/1.0.2/inc/hqlib/utils.php
r2387081 r2390989 80 80 } 81 81 82 return apply_filters('hqt/utils/get_public_post _types', $posts);82 return apply_filters('hqt/utils/get_public_posts', $posts); 83 83 } 84 84 -
hqtheme-extra/tags/1.0.2/readme.txt
r2387736 r2390989 5 5 Tested up to: 5.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 HQTheme Extra adds extra features to HQTheme and our plugins. For now it adds one click demo import for HQTheme. Our common library used by all our products is also part of HQTheme Extra. In future versions more features will be added. 15 Learn more on our website: [HQTheme.net](https://hqtheme.net )15 Learn more on our website: [HQTheme.net](https://hqtheme.net?utm_source=wporg&utm_medium=link&utm_campaign=default&utm_term=extra&utm_content=description) 16 16 17 17 … … 52 52 * Initial Public Release! 53 53 54 = 1.0. 0- 2020-09-24 =54 = 1.0.1 - 2020-09-24 = 55 55 * Group options for terms and meta 56 56 * Remove theme recommendation 57 58 = 1.0.2- 2020-09-30 = 59 * Filesystem class added in library 60 * get_terms_objects and get_terms_for_options added in library -
hqtheme-extra/trunk/hqtheme-extra.php
r2387736 r2390989 5 5 * Plugin URI: https://hqtheme.net/hqtheme/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=plugin-uri 6 6 * Description: HQTheme Extra adds extras for HQTheme - Ready sites one click import 7 * Version: 1.0. 17 * Version: 1.0.2 8 8 * Requires at least: 5.3 9 9 * Requires PHP: 7.2 … … 57 57 * @var string 58 58 */ 59 const VERSION = '1.0. 1';59 const VERSION = '1.0.2'; 60 60 61 61 // Load Autoloader -
hqtheme-extra/trunk/inc/demos/import-log.php
r2387081 r2390989 50 50 // Get user credentials for WP file-system API. 51 51 $import = wp_nonce_url(admin_url('themes.php?page=hqtheme-ready-sites'), 'hqt-import'); 52 $creds = request_filesystem_credentials($import, '', false, false, null);52 $creds = \request_filesystem_credentials($import, '', false, false, null); 53 53 if (false === $creds) { 54 54 return; -
hqtheme-extra/trunk/inc/dependencies.php
r2387736 r2390989 69 69 $install_url = wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $theme_wordpress_repo_slug), 'install-theme_' . $theme_wordpress_repo_slug); 70 70 $message = '<h3>' . $required_recommended . ' Theme - HQTheme</h3>' 71 . '<p>' . sprintf(_x('<b>%s</b> works best with <b>%s</b>. That\'s why we recommed <a href="%s" target="_blank">%s</a>. <br>Learn more about HQTheme <a href="%s" target="_blank" >here</a>.', 'theme dependency', 'hqtheme-e nhancer-pro'), $this->currnet_plugin_name, 'HQTheme', $theme_details_link, 'HQTheme', $theme_details_link) . '</p>';72 $message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s %s</a>', $install_url, _x('Install', 'theme dependency', 'hqtheme-e nhancer-pro'), 'HQTheme') . '</p>';71 . '<p>' . sprintf(_x('<b>%s</b> works best with <b>%s</b>. That\'s why we recommed <a href="%s" target="_blank">%s</a>. <br>Learn more about HQTheme <a href="%s" target="_blank" >here</a>.', 'theme dependency', 'hqtheme-extra'), $this->currnet_plugin_name, 'HQTheme', $theme_details_link, 'HQTheme', $theme_details_link) . '</p>'; 72 $message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s %s</a>', $install_url, _x('Install', 'theme dependency', 'hqtheme-extra'), 'HQTheme') . '</p>'; 73 73 Admin_Notifications::instance()->add_notice('theme-install', 'info', $message, $allow_dismis); 74 74 } -
hqtheme-extra/trunk/inc/hqlib/field/base.php
r2387736 r2390989 262 262 $data = \HQLib\hq_get_option($field_id, '', $this->default_value, 'theme_mods', false); 263 263 } else if ('post_meta' === $storage) { 264 $data = \HQLib\get_post_meta($field_id, '', $this->default_value, false); 264 $post_id = get_the_ID(); 265 $data = \HQLib\get_post_meta($post_id, $field_id, '', $this->default_value, false); 265 266 } else if ('tax_meta' === $storage) { 266 267 $term_id = isset($_REQUEST['tag_ID']) ? sanitize_key($_REQUEST['tag_ID']) : false; -
hqtheme-extra/trunk/inc/hqlib/helper.php
r2387081 r2390989 206 206 foreach ($terms as $term) { 207 207 $result[] = [ 208 'value' => $term-> slug,208 'value' => $term->term_id, 209 209 'label' => $term->name, 210 210 ]; -
hqtheme-extra/trunk/inc/hqlib/hqlib.php
r2387736 r2390989 120 120 * @return any 121 121 */ 122 function get_post_meta($key = null, $group = null, $default = false, $add_prefix = true) { 123 global $post; 124 125 if (!$post->ID) { 126 return $default; 122 function get_post_meta($post_id = null, $key = null, $group = null, $default = false, $add_prefix = true) { 123 if (!$post_id) { 124 global $post; 125 126 if (!$post->ID) { 127 return $default; 128 } 129 $post_id = $post->ID; 127 130 } 128 131 129 132 if ($group) { 130 133 $group = \HQLib\HQLIB_PREFIX . $group; 131 $options = \get_post_meta($post ->ID, $group, false);134 $options = \get_post_meta($post_id, $group, false); 132 135 if (empty($key)) { 133 136 return $options; … … 137 140 $key = empty($key) ? '' : \HQLib\HQLIB_PREFIX . $key; 138 141 } 139 return \get_post_meta($post ->ID, $key, true);142 return \get_post_meta($post_id, $key, true); 140 143 } 141 144 … … 182 185 183 186 /** 187 * Get terms objects list 188 * 189 * @param [type] $taxonomy 190 * @param boolean $child_of_current 191 * @return [type] 192 */ 193 function get_terms_objects($taxonomy = null, $child_of_current = false, $custom_args = array()) { 194 195 if (!$taxonomy) { 196 return array(); 197 } 198 199 if (!is_array($custom_args)) { 200 $custom_args = array(); 201 } 202 203 $args = array_merge(array('taxonomy' => $taxonomy), $custom_args); 204 205 if ($child_of_current && is_tax($taxonomy)) { 206 $args['child_of'] = get_queried_object_id(); 207 } 208 209 return \get_terms($args); 210 } 211 212 /** 213 * Get terms of passed taxonomy for options list 214 * 215 * @param [type] $taxonomy 216 * @param boolean $child_of_current 217 * @return [type] 218 */ 219 function get_terms_for_options($taxonomy = null, $child_of_current = false, $custom_args = array()) { 220 221 $terms = \HQLib\get_terms_objects($taxonomy, $child_of_current, $custom_args); 222 return wp_list_pluck($terms, 'name', 'term_id'); 223 } 224 225 /** 184 226 * Get global option 185 227 * @param string $key -
hqtheme-extra/trunk/inc/hqlib/utils.php
r2387081 r2390989 80 80 } 81 81 82 return apply_filters('hqt/utils/get_public_post _types', $posts);82 return apply_filters('hqt/utils/get_public_posts', $posts); 83 83 } 84 84 -
hqtheme-extra/trunk/readme.txt
r2387736 r2390989 5 5 Tested up to: 5.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 HQTheme Extra adds extra features to HQTheme and our plugins. For now it adds one click demo import for HQTheme. Our common library used by all our products is also part of HQTheme Extra. In future versions more features will be added. 15 Learn more on our website: [HQTheme.net](https://hqtheme.net )15 Learn more on our website: [HQTheme.net](https://hqtheme.net?utm_source=wporg&utm_medium=link&utm_campaign=default&utm_term=extra&utm_content=description) 16 16 17 17 … … 52 52 * Initial Public Release! 53 53 54 = 1.0. 0- 2020-09-24 =54 = 1.0.1 - 2020-09-24 = 55 55 * Group options for terms and meta 56 56 * Remove theme recommendation 57 58 = 1.0.2- 2020-09-30 = 59 * Filesystem class added in library 60 * get_terms_objects and get_terms_for_options added in library
Note: See TracChangeset
for help on using the changeset viewer.