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
-- | |
-- This query delelets all customers and orders from your | |
-- Magento 1.* install. Handy, if you have a bloated | |
-- Magento database and you need to do a bit | |
-- of cleaning up for use on a local machine. | |
-- | |
-- USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST. | |
-- | |
-- ----------------------------------------- |
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 | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); | |
function custom_excerpt_length( $length ) { | |
return 20; // number of words. Default is 55. | |
} | |
?> |
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 | |
//Create an admin user | |
function fws_temp_admin_user(){ | |
$username = 'superadmin'; //change this username | |
$password = 'temp_wp_pwd'; // change this password | |
$email = 'info@flyingweb.ie'; //change this email address | |
//This will ensure it only tries to create the user once (based on email/username) |
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 | |
// Fully Disable Gutenberg editor. | |
add_filter('use_block_editor_for_post_type', '__return_false', 10); | |
// Don't load Gutenberg-related stylesheets. | |
add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 ); | |
function remove_block_css() { | |
wp_dequeue_style( 'wp-block-library' ); // Wordpress core | |
wp_dequeue_style( 'wp-block-library-theme' ); // Wordpress core |
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
/** | |
* | |
* Reference: https://oxywp.com/polylang-condition-in-oxygen/ | |
*/ | |
<?php | |
if( function_exists('oxygen_vsb_register_condition') && function_exists('pll_languages_list') ) { | |
$lang_list = pll_languages_list(); |
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 filter_customcpt_by_taxonomies( $post_type, $which ) { | |
// Replace it with your custom post type | |
if ( 'custom_post_type' !== $post_type ) | |
return; | |
// Here you can add how many taxonomy you want | |
$taxonomies = array( 'testimonial_type' ); |
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 | |
if (function_exists('oxygen_vsb_register_condition') ) { | |
global $oxy_condition_operators; | |
oxygen_vsb_register_condition('Has Results', array('options'=>array('true', 'false'), 'custom'=>false), array('=='), 'search_has_results_callback', 'Search'); | |
function search_has_results_callback($value, $operator) { | |
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
/* Put this in a code block just BEFORE the repeater */ | |
/* WP_Query Reference: https://github.com/luetkemj/wp-query-ref */ | |
<?php | |
add_action( 'pre_get_posts', 'custom_query_name' ); | |
function custom_query_name( $query ) { | |
$cpt_id = get_queried_object_id(); |
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 //remove opening php tag | |
// add column(s) to admin cpt ui | |
add_filter ( 'manage_cptname_posts_columns', 'wd_add_acf_columns' ); | |
function wd_add_acf_columns ( $columns ) { | |
return array_merge ( $columns, array ( | |
'additional_column_1' => __ ( 'Column 1 Label' ), | |
'additional_column_2' => __ ( 'Column 2 Label' ), | |
)); | |
} |
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 | |
if ( function_exists( 'oxygen_vsb_register_condition' ) ) { | |
oxygen_vsb_register_condition( | |
// Condition Name | |
'ACF Field Not Empty', | |
// Values: The array of pre-set values the user can choose from. | |
// Set the custom key's value to true to allow users to input custom values. |