Changeset 1818276
- Timestamp:
- 02/08/2018 02:45:44 PM (8 years ago)
- Location:
- hq60-fidelity-card/trunk
- Files:
-
- 2 added
- 4 edited
-
hq60fidelitycard.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Hq60fidelitycard/Admin/AdminMenu.php (modified) (1 diff)
-
src/Hq60fidelitycard/Base.php (modified) (2 diffs)
-
src/Hq60fidelitycard/Cron (added)
-
src/Hq60fidelitycard/Cron/Cron.php (added)
Legend:
- Unmodified
- Added
- Removed
-
hq60-fidelity-card/trunk/hq60fidelitycard.php
r1817159 r1818276 7 7 Author: TRe Technology And Research S.r.l 8 8 Author URI: http://www.tresrl.it 9 Version: 1. 79 Version: 1.8 10 10 License: GPL-2.0+ 11 11 */ -
hq60-fidelity-card/trunk/readme.txt
r1817159 r1818276 4 4 Requires at least: 4.8.2 5 5 Tested up to: 4.9.4 6 Stable tag: 1. 76 Stable tag: 1.8 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 27 27 == Changelog == 28 29 = 1.8 = 30 * Cancellazione delle registrazioni non confermate dopo 24 ore 28 31 29 32 = 1.7 = -
hq60-fidelity-card/trunk/src/Hq60fidelitycard/Admin/AdminMenu.php
r1817159 r1818276 123 123 add_action( 'admin_menu' , array ( $this , 'add_admin_settings_menu' ) ); 124 124 125 add_filter( 'pre_get_posts' , array ( $this , 'set_custom_post_order' ) ); 126 125 127 } 128 129 /** 130 * Order the custom post. 131 * Called from create_admin_settings_menu 132 * 133 * @since 1.0 134 * 135 */ 136 137 138 public function set_custom_post_order ($wp_query) { 139 140 if (is_admin()) { 141 142 // Get the post type from the query 143 $post_type = $wp_query->query['post_type']; 144 145 if ( $post_type == $this->get_custom_post_name() ) { 146 147 // 'orderby' value can be any column name 148 $wp_query->set('orderby', $this->get_custom_post_name().'-date' ); 149 150 // 'order' value can be ASC or DESC 151 $wp_query->set('order', 'DESC'); 152 153 } 154 155 } 156 157 } 126 158 127 159 /** -
hq60-fidelity-card/trunk/src/Hq60fidelitycard/Base.php
r1807910 r1818276 245 245 $this->register_custom_post(); 246 246 247 248 //$this->delete_unconfirmed_registration(); 249 250 //$cron = new \Hq60fidelitycard\Cron\Cron( $this->get_custom_post_name() ); 251 //$cron->delete_unconfirmed_registration(); 252 253 254 255 } 256 257 /** 258 * Delete unconfirmed registration 259 * 260 * @since 1.7.1 261 * 262 */ 263 public function delete_unconfirmed_registration() { 264 265 $post = null; 266 267 $args = array ( 268 269 270 'posts_per_page' => -1, 271 'post_type' => $this->get_custom_post_name(), 272 273 'date_query' => array( 274 275 'before' => date('Y-m-d H:i:s', strtotime('-1 days')) 276 277 ) 278 279 280 ); 281 282 /*$first_key = array ( 283 284 'key' => $this->get_custom_post_name().'-confirmed-on', 285 'compare' => 'NOT EXISTS' 286 287 );*/ 288 289 $first_key = null; 290 291 $meta_query = array ( 292 293 $first_key 294 295 ); 296 297 $args['meta_query'] = array($meta_query); 298 299 $temp = new \WP_Query( $args ); 300 301 if ( $temp->have_posts() ) { 302 303 while ( $temp->have_posts() ) { 304 305 $temp->the_post(); 306 307 $id_post = get_the_ID(); 308 309 wp_delete_post($id_post); 310 311 312 } 313 314 } 315 247 316 } 248 317 … … 701 770 // Inizializzazione della funzione 702 771 add_action( 'init', array( $this , 'callback_create_custom_post_type' ) ); 772 773 add_action ( 'init' , array ( $this , 'delete_unconfirmed_registration' ) ); 703 774 704 775 }
Note: See TracChangeset
for help on using the changeset viewer.