is_main_query() && is_category() ) { $settings = get_option( rtTPG()->options['settings'] ); $sc_id = isset( $settings['template_category'] ) ? absint( $settings['template_category'] ) : 0; if ( $sc_id ) { $posts_per_page = $sc_id ? absint( get_post_meta( $sc_id, 'posts_per_page', true ) ) : 0; $pagination = $sc_id ? get_post_meta( $sc_id, 'pagination', true ) : false; $posts_loading_type = $sc_id ? get_post_meta( $sc_id, 'posts_loading_type', true ) : ''; if ( $pagination && 'pagination' === $posts_loading_type && $posts_per_page ) { $query->set( 'posts_per_page', $posts_per_page ); } } } } public static function filter_post_row_actions( $actions, $post ) { global $pagenow; if ( 'edit.php' === $pagenow ) { global $post; $new_items['edit_with_elementor'] = sprintf( 'ID: %s', $post->ID ); $actions = array_merge( $actions, $new_items ); } return $actions; } public static function rttpg_daily_scheduled_events() { try { global $wpdb; $expired = $wpdb->get_col( "SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE '_transient_timeout%' AND option_value < UNIX_TIMESTAMP()" ); foreach ( $expired as $transient ) { $key = str_replace('_transient_timeout_tpg_cache_', 'tpg_cache_', $transient); delete_transient( $key ); } } catch ( \Exception $e ) { } } }