This file contains hidden or 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
// Copyright Text | |
$wp_customize->add_setting( 'site_copyright', array( | |
'sanitize_callback' => 'wp_kses_post', | |
) ); | |
$wp_customize->add_control( new WP_Customize_TinyMCE_Control( $wp_customize, 'site_copyright', array( | |
'label' => __( 'Copyright Text', 'hadrian-wholesale' ), | |
'section' => 'contact_info', | |
'settings' => 'site_copyright', | |
'type' => 'textarea', | |
'input_attrs' => [ |
This file contains hidden or 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
/* | |
* Disable WordPress Plugin Update Notification | |
*/ | |
function wp98_theme_init() { | |
add_filter( 'auto_plugin_update_send_email', '__return_false' ); | |
} | |
add_action( 'init', 'wp98_theme_init' ); | |
/* |
This file contains hidden or 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
/** | |
* Prevent update notification for plugin | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { | |
if ( isset($value) && is_object($value) ) { | |
$plugins = array('elementor/elementor.php', 'elementor-pro/elementor-pro.php'); | |
foreach($plugins as $plugin){ | |
if ( isset( $value->response[$plugin] ) ) { |
This file contains hidden or 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
#!/bin/bash | |
# My custom script to configuring TinkerOS post install as a desktop replacement. For personal use | |
sudo apt-get update | |
# disable swap to reduce SD card wear | |
sudo swapoff -a | |
# Setup numlockx for default numlock on at startup | |
sudo apt-get install numlockx |
This file contains hidden or 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
function ws365150_custom_edit_box() { | |
global $post; | |
?> | |
<div class="inline-edit-group wc-shipping-text"> | |
<label> | |
<span class="title">Shipping Text</span> | |
<span class="input-text-wrap"> | |
<input type="text" name="_shipping_text" value="<?php echo get_post_meta( $post->ID, '_shipping_text', true ); ?>"> | |
</span> | |
</label> |
This file contains hidden or 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
# Convert .svg | |
convertsvgto(){ | |
EXT=$1; | |
if [[ -z "$EXT" ]]; then | |
EXT="jpg"; | |
fi | |
for file in *.svg; do echo "Converting ${file%.*} Image to $EXT"; convert $file "${file%.*}"."$EXT"; done; | |
echo "Convert Successful..." | |
} |
This file contains hidden or 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
function modify_gutenberg_column_block( $block_content, $block ) { | |
if ( $block['blockName'] == 'core/columns' ) { | |
$block_content = str_replace( 'wp-block-columns', 'row', $block_content ); | |
$block_content = '<div class="container">' . $block_content . '</div>'; | |
} | |
if ( $block['blockName'] == 'core/column' ) { | |
$block_content = str_replace( 'wp-block-column', 'col', $block_content ); | |
} | |
This file contains hidden or 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
function modify_post_info_content( $content, $ele ) { | |
$name = $ele->get_name(); | |
if ( $name == 'post-info' ) { | |
$settings = $ele->get_settings_for_display(); | |
if ( ! empty( $settings['icon_list'] ) ) { | |
foreach ( $settings['icon_list'] as $repeater_item ) { | |
if ( $repeater_item['type'] == 'terms' ) { | |
$content = str_replace( ',', '', $content ); | |
} | |
} |
This file contains hidden or 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
function be_header_menu_desc( $item_output, $item ) { | |
if ( $item->description ) { | |
$item_output = str_replace( '</a>', '</a><div class="description">' . apply_shortcodes( $item->description ) . '</div>', $item_output ); | |
} | |
return $item_output; | |
} | |
add_filter( 'walker_nav_menu_start_el', 'be_header_menu_desc', 10, 2 ); |
This file contains hidden or 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
/* | |
* Add image alt text to product page. | |
*/ | |
function theme_wp_get_attachment_image_attributes( $attr ) { | |
if ( ! is_admin() && is_product() ) { | |
$attr['alt'] = get_the_title(); | |
} | |
return $attr; | |
} |