This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = new WP_Query(array( | |
'post_type' => 'company', | |
'posts_per_page' => -1 | |
)); | |
$posts = []; | |
while ($query->have_posts()) { | |
$query->the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// META QUERY | |
function searchExcludeOldMatches( $query ) { | |
if (!is_admin() && $query->is_search) { | |
$query->set('meta_query', array( | |
array( | |
'key' => 'ctl_visibility', | |
'value' => 'true', | |
'compare' => '=', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem *.7z | foreach-Object -parallel { | |
& "C:\Program Files\7-Zip\7z.exe" -aoa x $_.FullName -o* | |
} -ThrottleLimit 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function convert_tax($post_type, $old_tax, $new_tax) { | |
$pages = get_posts(array( | |
'post_type' => $post_type, | |
// Get all post statuses | |
'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash'), | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
array( | |
'taxonomy' => $old_tax, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'events', // Adjust post type if needed | |
'posts_per_page' => -1, // Retrieve all posts | |
); | |
$posts_query = new WP_Query($args); | |
if ($posts_query->have_posts()) { | |
while ($posts_query->have_posts()) { |