Snippets Collections
function year_shortcode() {
  $year = date('Y');
  return $year;
}
add_shortcode('year', 'year_shortcode');
<?php>
function applyCustomStyles() {
    echo '
    <style>

    /* Change link colour to white */
    #wpbody-content a {
    filter: invert(1) hue-rotate(180deg) saturate(10);
    color: white !important;
    }

    /* Change link colour to yellow */
    #wpbody-content a:hover {
    filter: invert(1) hue-rotate(180deg) saturate(10);
    color: red !important;
    }
    
    /* Styling for primary content area. */
    .block-editor-page .editor-styles-wrapper {
      color: lightgray;
      background: #262626;
    }
    
    /* Base styling adjustments. */
    .wp-admin {
      background-color: #262626;
    }
    
    /* Image display corrections. */
    .wp-admin #wpbody img {
      filter: invert(1) hue-rotate(-180deg);
      background: white;
    }

    /* Enhancements for hyperlink visuals. */
    .block-editor-page .editor-styles-wrapper a {
      filter: invert(0.85) hue-rotate(185deg);
    }
    
    /* Filter reset for specific editor sections. */
    .block-editor-page #wpbody {
      filter: unset;
    }

    /* Adjustments for the main body appearance. */
    .wp-admin #wpbody {
      filter: invert(0.85) hue-rotate(185deg);
    }

    /* Sidebar appearance customization. */
    .block-editor-page .interface-interface-skeleton__sidebar,
    .block-editor-page .interface-interface-skeleton__secondary-sidebar {
      filter: invert(0.85) hue-rotate(185deg);
    }

    /* Configuration for top navigation bar. */
    .block-editor-page .interface-interface-skeleton__header {
      filter: invert(0.85) hue-rotate(185deg);
    }
    
    /* Primary action button styling. */
    .block-editor-page .is-primary {
      color: black !important;
    }
    
    /* Lower section layout adjustments. */
    .block-editor-page .edit-post-layout__metaboxes {
      border-top: 0px;
      background-color: #262626;
    }

    /* Reset various button BG colours */
    .wrap .add-new-h2, .wrap .add-new-h2:active, .wrap .page-title-action, .wrap .page-title-action:active {
    background:#f6f7f700;
    }
    
    </style>';
}
add_action('admin_head', 'applyCustomStyles');
add_action('rest_api_init', 'register_reset_password_route');

function register_reset_password_route() {
    register_rest_route('wp/v1', '/users/resetpassword', array(
        'methods' => 'POST',
        'callback' => 'reset_password_callback',
        'permission_callback' => '__return_true',
    ));
}

function reset_password_callback($request) {
    $user_data = $request->get_params();

    if (empty($user_data['email'])) {
        return new WP_REST_Response(array(
            'success' => false,
            'message' => 'البريد الإلكتروني مطلوب',
        ), 400);
    }

    $user = get_user_by('email', $user_data['email']);

    if (!$user) {
        return new WP_REST_Response(array(
            'success' => false,
            'message' => 'المستخدم غير موجود',
        ), 404);
    }

    $reset = wp_generate_password(12, false);

    $result = wp_set_password($reset, $user->ID);

    if (is_wp_error($result)) {
        return new WP_REST_Response(array(
            'success' => false,
            'message' => $result->get_error_message(),
        ), 500);
    } else {
        wp_mail($user->user_email, 'إعادة تعيين كلمة المرور', 'تمت إعادة تعيين كلمة مرورك بنجاح. كلمة مرورك الجديدة هي: ' . $reset);

        return new WP_REST_Response(array(
            'success' => true,
            'message' => 'تم إعادة تعيين كلمة المرور بنجاح. يرجى التحقق من بريدك الإلكتروني للحصول على كلمة المرور الجديدة.',
        ), 200);
    }
}
/**
 * 	Show ID in Wordpress
 * 
	Add ID in the action row of list tables for pages, posts,
	custom post types, media, taxonomies, custom taxonomies,
	users amd comments
	
	Inspiration:
	https://wordpress.org/plugins/admin-site-enhancements/
	https://www.itsupportguides.com/knowledge-base/wordpress/using-wordpress-post_row_actions-php-filter/
*/

add_filter('post_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('page_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('cat_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('tag_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('media_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('comment_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);
add_filter('user_row_actions', 'add_custom_action_for_specific_post_type', 11, 2);

/* Output the ID in the action row */
function add_custom_action_for_specific_post_type( $actions, $object ) {
        
	if ( current_user_can( 'edit_posts' ) ) {
		// For pages, posts, custom post types, media/attachments, users
		if ( property_exists( $object, 'ID' ) ) {
			$id = $object->ID;
		}
		// For taxonomies
		if ( property_exists( $object, 'term_id' ) ) {
			$id = $object->term_id;
		}
		// For comments
		if ( property_exists( $object, 'comment_ID' ) ) {
			$id = $object->comment_ID;
		}
		$actions['show-id-now'] = '<span style="color: gray;">ID: ' . $id . '</span>';
	}
	return $actions;
}
if ( is_single() ) {
  $current_post_id = get_queried_object_id();
  $current_category_id = get_the_category( $current_post_id )[0]->cat_ID;

  $args = array(
    'category' => $current_category_id,
    'post__not_in' => array( $current_post_id ),
    'posts_per_page' => 3,
  );

  $related_posts = new WP_Query( $args );

  if ( $related_posts->have_posts() ) {
    echo '<h2>Related Posts:</h2>';
    while ( $related_posts->have_posts() ) {
      $related_posts->the_post();
      echo '<a href="' . get_the_permalink() . '">' . get_the_title() . '</a><br>';
    }
    wp_reset_postdata();
  }
}
// Function.php
add_action( 'woocommerce_product_options_pricing', 'add_international_to_products' );      
function add_international_to_products() {          
    woocommerce_wp_text_input( array( 
        'id' => 'international_price', 
        'class' => 'short wc_input_price', 
        'label' => __( 'International Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',
        'data_type' => 'price', 
    ));      
}

add_action( 'save_post_product', 'save_international' );  
function save_international( $product_id ) {
    global $typenow;
    if ( 'product' === $typenow ) {
        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
        if ( isset( $_POST['international_price'] ) ) {
            update_post_meta( $product_id, 'international_price', $_POST['international_price'] );
        }
    }
}
// Display Code hook throw
add_action( 'woocommerce_single_product_summary', 'display_international', 9 );  
function display_international() {
    global $product;
    if ( $product->get_type() <> 'variable' && $rrp = get_post_meta( $product->get_id(), 'international_price', true ) ) {
        echo '<div class="woocommerce_international_price">';
		echo '<span>' . wc_price( $rrp ) . '</span>';
        _e( '<p>for International Customer</p> ', 'woocommerce' );       
        echo '</div>';
    }
}

function find_order_with_product_for_user($user_id, $product_id) {
	global $wpdb;

	// Get the order IDs for the user
	$order_ids = $wpdb->get_col("
        SELECT DISTINCT order_items.order_id
        FROM wp_woocommerce_order_items as order_items
        LEFT JOIN wp_woocommerce_order_itemmeta as order_itemmeta ON order_items.order_item_id = order_itemmeta.order_item_id
        LEFT JOIN wp_posts as posts ON order_items.order_id = posts.ID
        LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.ID
        WHERE posts.post_type = 'shop_order'
        AND posts.post_status IN ('wc-processing', 'wc-completed')
        AND order_itemmeta.meta_key = '_product_id'
        AND order_itemmeta.meta_value = '$product_id'
        AND postmeta.meta_key = '_customer_user'
        AND postmeta.meta_value = '$user_id'
    ");

	// If orders are found, return the order IDs
	if ($order_ids) {
		return $order_ids;
	}

	return false;
}
function course_woocommerce_product_downloads_shortcode($atts) {
	// Extract shortcode attributes
	$atts = shortcode_atts(
		array(
			'product_id' => get_the_ID(), // Specify the product ID
		),
		$atts,
		'custom_woocommerce_product_downloads'
	);

	// Check if the product ID is provided
	if (empty($atts['product_id'])) {
		return '';
	}

	// Get the product object
	$product = wc_get_product($atts['product_id']);
	$order_ids = find_order_with_product_for_user(get_current_user_id(), $atts['product_id']);

	// Check if the product is downloadable
	if ($product && $product->is_downloadable() &&  wc_customer_bought_product(get_current_user_id(), get_current_user_id(), get_the_ID())) {
		$order = wc_get_order(current($order_ids));
		$downloads = $order->get_downloadable_items();
		// Check if there are downloads
		if ($downloads) {
			// Output a list of download files
			$output = '<h2>دانلود دوره خریداری شده ' . esc_html($product->get_name()) . '</h2>';
			$output .= '<ul>';
			foreach ($downloads as $download) {
				if($download['product_id'] != $atts['product_id']){
					continue;
				}
				$output .= '<li><a href="' . esc_url($download['download_url']) . '">' . esc_html($download['download_name']) . "</a></li>";
			}
			$output .= '</ul>';
		} else {
			$output = '<p>هیچ فایل دانلودی برای این دوره موجود نیست.</p>';
		}
	} else {
		$output = '<p>برای مشاهده فایل ها لطفا ابتدا دوره را خریداری کنید</p>';
	}

	return $output;
}
add_shortcode('course_woocommerce_product_downloads', 'course_woocommerce_product_downloads_shortcode');
function find_order_with_product_for_user($user_id, $product_id) {
	global $wpdb;

	// Get the order IDs for the user
	$order_ids = $wpdb->get_col("
        SELECT DISTINCT order_items.order_id
        FROM wp_woocommerce_order_items as order_items
        LEFT JOIN wp_woocommerce_order_itemmeta as order_itemmeta ON order_items.order_item_id = order_itemmeta.order_item_id
        LEFT JOIN wp_posts as posts ON order_items.order_id = posts.ID
        LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.ID
        WHERE posts.post_type = 'shop_order'
        AND posts.post_status IN ('wc-processing', 'wc-completed')
        AND order_itemmeta.meta_key = '_product_id'
        AND order_itemmeta.meta_value = '$product_id'
        AND postmeta.meta_key = '_customer_user'
        AND postmeta.meta_value = '$user_id'
    ");

	// If orders are found, return the order IDs
	if ($order_ids) {
		return $order_ids;
	}

	return false;
}
function course_woocommerce_product_downloads_shortcode($atts) {
	// Extract shortcode attributes
	$atts = shortcode_atts(
		array(
			'product_id' => get_the_ID(), // Specify the product ID
		),
		$atts,
		'custom_woocommerce_product_downloads'
	);

	// Check if the product ID is provided
	if (empty($atts['product_id'])) {
		return '';
	}

	// Get the product object
	$product = wc_get_product($atts['product_id']);
	$order_ids = find_order_with_product_for_user(get_current_user_id(), $atts['product_id']);

	// Check if the product is downloadable
	if ($product && $product->is_downloadable() &&  wc_customer_bought_product(get_current_user_id(), get_current_user_id(), get_the_ID())) {
		$order = wc_get_order(current($order_ids));
		$downloads = $order->get_downloadable_items();
		// Check if there are downloads
		if ($downloads) {
			// Output a list of download files
			$output = '<h2>دانلود دوره خریداری شده ' . esc_html($product->get_name()) . '</h2>';
			$output .= '<ul>';
			foreach ($downloads as $download) {
				if($download['product_id'] != $atts['product_id']){
					continue;
				}
				$output .= '<li><a href="' . esc_url($download['download_url']) . '">' . esc_html($download['download_name']) . "</a></li>";
			}
			$output .= '</ul>';
		} else {
			$output = '<p>هیچ فایل دانلودی برای این دوره موجود نیست.</p>';
		}
	} else {
		$output = '<p>برای مشاهده فایل ها لطفا ابتدا دوره را خریداری کنید</p>';
	}

	return $output;
}
add_shortcode('course_woocommerce_product_downloads', 'course_woocommerce_product_downloads_shortcode');
jQuery( function( $ ) {
	// Add space for Elementor Menu Anchor link
	if ( window.elementorFrontend ) {
		elementorFrontend.hooks.addFilter( 'frontend/handlers/menu_anchor/scroll_top_distance', function( scrollTop ) {
			return scrollTop - 30;
		} );
	}
} );
https://www.example.com/feed?post_type=custom_post_type
<a href=%fil|file_url_by_id% target="_blank">%fil-titel%</a>
--------------------------------------------------------------------------------------
# docker-compose.yaml
--------------------------------------------------------------------------------------
version: '3.6'

services:
  db:
    image: mariadb:latest
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: wpdb
      MYSQL_USER: wpdbuser
      MYSQL_PASSWORD: wppasswd
      VIRTUAL_HOST: example.com, www.example.com
    volumes:
      - ./data_db:/var/lib/mysql
    networks:
      - wpsite

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    depends_on:
      - db
    restart: unless-stopped
    ports:
      - 18000:80
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: root
    networks:
      - wpsite

  wordpress:
    image: wordpress:latest
    depends_on:
      - db
    restart: unless-stopped
    ports:
      - 18001:80
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: wpdb
      WORDPRESS_DB_USER: wpdbuser
      WORDPRESS_DB_PASSWORD: wppasswd
    volumes:
      - ./YOUR_WORDPRESS_FOLDER:/var/www/html
    networks:
      - wpsite

   nginx: 
    build: 
      context: ./nginx
    ports: 
      - 80:80
    networks: 
      - nextjs-app

networks:
  wpsite:


#---------------------------------------------------------------------------
#./nginx/Dockerfile
#---------------------------------------------------------------------------
FROM nginx

# Remove any existing config files
RUN rm /etc/nginx/conf.d/\*

# Copy config files
COPY ./default.conf /etc/nginx/conf.d/

# If you want basic auth create a .htpasswd 
# COPY ./.htpasswd ./etc/nginx/.htpasswd

# Expose the listening port
EXPOSE 80

# Launch NGINX
CMD [ "nginx", "-g", "daemon off;" ]

#-------------------------------------------------------------------------
#./nginx/default.conf
#-------------------------------------------------------------------------

upstream nextjs {
  server wordpress:18001;
}

server {
    listen 80;
    server_name _;
    server_tokens off;

    gzip on;
    gzip_proxied any;
    gzip_comp_level 4;
    gzip_types text/css application/javascript image/svg+xml;

    
    
    location / {
    	proxy_pass: http://wordpress;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        #auth_basic "Restricted Content";
    	#auth_basic_user_file /etc/nginx/.htpasswd;
    }
    
}


;MainWP Requriement - cURL timeout
default_socket_timeout = 300
;END MainWP Requriement
	<?php
// 	if ( $sent_to_admin ) {
// 		$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
// 		$after  = '</a>';
// 	} else {
// 		$before = '';
// 		$after  = '';
// 	}
	
	$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
	$after  = '</a>';
	
<?php
$usernames = ['username1', 'username2', ...]; // An array of the usernames of the users you want to change the role for
$new_role = 'new_role'; // The new role you want to assign to the users

foreach ($usernames as $username) {
    $user = get_user_by('login', $username);
    if (!empty($user)) {
        $user->set_role($new_role);
    }
}
?>
<?php
$user = get_userdatabylogin('YOUR_USERNAME');
grant_super_admin($user->ID);
?>
function example_return_select_label ($field_selector, $post_id) {
	$field = get_field_object($field_selector, $post_id);

	$choices = $field['choices'];
	$value = $field['value'];

	if ( isset($choices[$value]) ) {
		return $choices[$value];
	}
}


// Example usage (https://d.pr/i/Xj7DQ3):
//[example_return_select_label("field_6247468a6a53a",{ID})]
<?php

// Load assets on the "about" page (https://yoursite.com/about/)
// Add the following to your (child) theme's functions.php

add_filter( 'facetwp_load_assets', function( $bool ) {
    if ( 'about' == FWP()->helper->get_uri() ) {
        $bool = true;
    }
    return $bool;
});
docker image ls
docker images
docker image history imagename
docker build -t imagename:version path
FROM ubuntu:18.04

RUN apt-get update
RUN apt-get install -y curl

COPY . /app

RUN ls -l

CMD python /app/app.py










docker build -t imagename:version path
create mysql container
for find server of the mysql run command :
docker container inspect mysql
find Networks.brigde.IpAddress
copy ip address and use 
// RECOMMENDED WAY
// Install plugin Query Monitor

// In your code call:
do_action( 'qm/debug', 'This happened!' );

$my_user = get_userdata(1);
do_action( 'qm/debug', $my_user );

$my_post = get_post(9);
do_action('qm/debug', $my_post);


// OFFICIAL WAY
// This should go into wp-config.php 

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
//How to Disable Gutenberg & Return to the Classic WordPress Editor Without any Plugins

add_filter( 'use_block_editor_for_post', '__return_false' );
// After login, redirect to a specific page

add_filter( 'woocommerce_login_redirect', 'woocommerce_customer_login_redirect', 9999, 2 );
 
function woocommerce_customer_login_redirect( $redirect, $user ) {
     
    if ( wc_user_has_role( $user, 'customer' ) ) {
        $redirect = get_home_url(); // 홈페이지, homepage
        //$redirect = wc_get_page_permalink( 'shop' ); // 상점 페이지, shop page
        //$redirect = '/custom_url'; // 동일 사이트 내의 커스텀 URL, custom URL same site
        //$redirect = 'https://custom.url'; // 다른 사이트의 커스텀 URL, custom URL other site
        //$redirect = add_query_arg( 'password-reset', 'true', wc_get_page_permalink( 'myaccount' ) ); // 커스텀 내 계정 탭, custom My Account tab
    }
  
    return $redirect;
}
add_filter( 'woocommerce_checkout_fields', 'puripia_remove_fields', 9999 );
 
function puripia_remove_fields( $fields ) {
 
  // unset( $fields['billing']['billing_first_name'] );
  unset( $fields['billing']['billing_last_name'] ); // 성 필드 제거
  // unset( $fields['billing']['billing_phone'] );
  // unset( $fields['billing']['billing_email'] );
  unset( $fields['billing']['billing_company'] ); // 회사 필드 제거
  unset( $fields['billing']['billing_country'] ); // 국가 필드 제거
  //unset( $fields['billing']['billing_address_1'] );
  //unset( $fields['billing']['billing_address_2'] );
  unset( $fields['billing']['billing_city'] ); // 도시 주소 필드 제거
  unset( $fields['billing']['billing_state'] ); // 주(state) 줏 필드 제거
  //unset( $fields['billing']['billing_postcode'] ); 
 
  // unset( $fields['shipping']['shipping_first_name'] );
  unset( $fields['shipping']['shipping_last_name'] ); // 성 필드 제거
  // unset( $fields['shipping']['shipping_email'] );
  // and to remove the shipping fields below
  unset( $fields['shipping']['shipping_company'] ); // 회사 필드 제거
  unset( $fields['shipping']['shipping_country'] ); // 국가 필드 제거
  //unset( $fields['shipping']['shipping_address_1'] );
  //unset( $fields['shipping']['shipping_address_2'] );
  unset( $fields['shipping']['shipping_city'] ); // 도시 주소 필드 제거
  unset( $fields['shipping']['shipping_state'] ); // 주(state) 주소 필드 제거
  //unset( $fields['shipping']['shipping_postcode'] ); 

  // unset( $fields['order']['order_comments'] ); 

  return $fields;
}
/** Currency Symbol Change Start **/

add_filter('woocommerce_currencies', 'my_woocommerce_currencies');
function my_woocommerce_currencies($currencies){
    $currencies['KRW'] = '대한민국';
    return $currencies;
}
add_filter('woocommerce_currency_symbol', 'my_woocommerce_currency_symbol', 10, 2);
function my_woocommerce_currency_symbol($currency_symbol, $currency){
    switch($currency){
        case 'KRW': $currency_symbol = '원'; break;
    }
    return $currency_symbol;
}

/** Currency Symbol Change End **/
// registro de la hoja de estilo extra
<?php
wp_register_style( $handle, $src, $deps, $ver, $media );
?>

// poner en cola la hoja de estilo extra
<?php
wp_enqueue_style( $handle, $src, $deps, $ver, $media );
?>
  
/* NoTA: Registrar estilos es, de algún modo, algo "opcional" en WordPress. Si crees que tu estilo no va a ser utilizado por ningún plugin o no vas a usar ningún código para cargarlo de nuevo, eres libre de ponerlo en cola sin registrarlo. Fíjate cómo se hace a continuación. */
<?php

add_action( 'wp_head', function () { ?>

<style>

.logged-in .login_link, .logout_link {

    display: none;

}

 

.logged-in .logout_link {
    display: block;
}

</style>

<?php } );
<?php

add_filter( 'acf/validate_value/name=property_size', 'validate_property_size_field', 10, 4 );

function validate_property_size_field( $valid, $value, $field, $input ){

  // bail early if value is already invalid
  if ( ! $valid ) { return $valid; }

  $property_type = $_POST['acf']['field_5f0aa92348bb6'];

  if ( $property_type == 'Rent' ){
    if ( ! $value ) {
      $valid = __( 'This field is required for Rental Properties' );
    }
  }

  return $valid;

}

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www.olddomain.com$
      RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
    </IfModule>

/* put in functions.php */
function register_navwalker() {
   require_once get_template_directory() . '/wp-bootstrap5-walker.php';
  //or place code directly in functions.php
}
add_action( 'after_setup_theme', 'register_navwalker' );


/* place in header of theme */
<nav class="navbar navbar-expand-md navbar-light bg-light">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">Navbar</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        
        <div class="collapse navbar-collapse" id="main-menu">
            <?php
            wp_nav_menu(array(
                'theme_location' => 'main-menu',
                'container' => false,
                'menu_class' => '',
                'fallback_cb' => '__return_false',
                'items_wrap' => '<ul id="%1$s" class="navbar-nav me-auto mb-2 mb-md-0 %2$s">%3$s</ul>',
                'depth' => 2,
                'walker' => new bootstrap_5_wp_nav_menu_walker()
            ));
            ?>
        </div>
    </div>
</nav>

  
 /* Nav walker menu code - place in file or functions.php */
  
 <?php
// bootstrap 5 wp_nav_menu walker
class bootstrap_5_wp_nav_menu_walker extends Walker_Nav_menu
{
  private $current_item;
  private $dropdown_menu_alignment_values = [
    'dropdown-menu-start',
    'dropdown-menu-end',
    'dropdown-menu-sm-start',
    'dropdown-menu-sm-end',
    'dropdown-menu-md-start',
    'dropdown-menu-md-end',
    'dropdown-menu-lg-start',
    'dropdown-menu-lg-end',
    'dropdown-menu-xl-start',
    'dropdown-menu-xl-end',
    'dropdown-menu-xxl-start',
    'dropdown-menu-xxl-end'
  ];

  function start_lvl(&$output, $depth = 0, $args = null)
  {
    $dropdown_menu_class[] = '';
    foreach($this->current_item->classes as $class) {
      if(in_array($class, $this->dropdown_menu_alignment_values)) {
        $dropdown_menu_class[] = $class;
      }
    }
    $indent = str_repeat("\t", $depth);
    $submenu = ($depth > 0) ? ' sub-menu' : '';
    $output .= "\n$indent<ul class=\"dropdown-menu$submenu " . esc_attr(implode(" ",$dropdown_menu_class)) . " depth_$depth\">\n";
  }

  function start_el(&$output, $item, $depth = 0, $args = null, $id = 0)
  {
    $this->current_item = $item;

    $indent = ($depth) ? str_repeat("\t", $depth) : '';

    $li_attributes = '';
    $class_names = $value = '';

    $classes = empty($item->classes) ? array() : (array) $item->classes;

    $classes[] = ($args->walker->has_children) ? 'dropdown' : '';
    $classes[] = 'nav-item';
    $classes[] = 'nav-item-' . $item->ID;
    if ($depth && $args->walker->has_children) {
      $classes[] = 'dropdown-menu dropdown-menu-end';
    }

    $class_names =  join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
    $class_names = ' class="' . esc_attr($class_names) . '"';

    $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
    $id = strlen($id) ? ' id="' . esc_attr($id) . '"' : '';

    $output .= $indent . '<li ' . $id . $value . $class_names . $li_attributes . '>';

    $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : '';
    $attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : '';
    $attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : '';
    $attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';

    $active_class = ($item->current || $item->current_item_ancestor || in_array("current_page_parent", $item->classes, true) || in_array("current-post-ancestor", $item->classes, true)) ? 'active' : '';
    $nav_link_class = ( $depth > 0 ) ? 'dropdown-item ' : 'nav-link ';
    $attributes .= ( $args->walker->has_children ) ? ' class="'. $nav_link_class . $active_class . ' dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"' : ' class="'. $nav_link_class . $active_class . '"';

    $item_output = $args->before;
    $item_output .= '<a' . $attributes . '>';
    $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
    $item_output .= '</a>';
    $item_output .= $args->after;

    $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
  }
}
// register a new menu
register_nav_menu('main-menu', 'Main menu');
https://themeisle.com/blog/hide-wordpress-admin-bar/#specific-user-roles
// Option 1:
<?php echo substr(get_the_excerpt(), 0, 150); ?>

// Option 2: ends with ...
<?php echo wp_trim_words(get_the_excerpt(), 15); ?> 
// cleaned/stripped text only
<?php echo strip_tags(get_the_term_list($post->ID,'custom_tax','',', ')); ?>
  
  //alternate: <?php echo get_the_term_list($post->ID,'custom_tax','',', '); ?>
Regular space "\0020" 
Non breaking space "\00A0"
function attachment_search( $query ) {
    if ( $query->is_search ) {
       $query->set( 'post_type', array( 'post', 'attachment' ) );
       $query->set( 'post_status', array( 'publish', 'inherit' ) );
    }
 
   return $query;
}

add_filter( 'pre_get_posts', 'attachment_search' );
/**
 * Plugin Name:       My Basics Plugin
 * Plugin URI:        https://example.com/plugins/the-basics/
 * Description:       Handle the basics with this plugin.
 * Version:           1.10.3
 * Requires at least: 5.2
 * Requires PHP:      7.2
 * Author:            John Smith
 * Author URI:        https://author.example.com/
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Update URI:        https://example.com/my-plugin/
 * Text Domain:       my-basics-plugin
 * Domain Path:       /languages
 */
<object data="PDF URL" type="application/pdf" width="700px" height="1200px">    
<embed src="PDF URL" />    
</object>
<!-- Get all tags displayed -->
    <nav class="all-tags">
        <ul>
            <?php
                $tags = get_tags('post_tag'); //taxonomy=post_tag
        
                if ( $tags ) :
                foreach ( $tags as $tag ) : ?>
                    <li class="tags">
                        <a href="<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" 							title="<?php echo esc_attr( $tag->name ); ?>">
                        <?php echo esc_html( $tag->name ); ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </nav>
$( ".variations_form" ).on( "woocommerce_variation_select_change", function () {
    // Fires whenever variation selects are changed
} );

$( ".single_variation_wrap" ).on( "show_variation", function ( event, variation ) {
    // Fired when the user selects all the required dropdowns / attributes
    // and a final variation is selected / shown
} );
<?php

if( have_rows('your_group') ): while ( have_rows('your_group') ) : the_row(); 

    if( have_rows('your_repeater') ): while ( have_rows('your_repeater') ) : the_row();       

        echo get_sub_field('repeater_sub_field');

    endwhile; endif;

endwhile; endif;

?>
/**
*   WooCommerce woocommerce_order_item_line_item_html action hook registeration.
*/
add_action('woocommerce_order_item_line_item_html', 'woocommerce_order_item_line_item_html', 1, 3);


/**
* Callback Listener for customised line item functionality in the admin.
*/
function woocommerce_order_item_line_item_html($item_id, $item, $order){
    // Add your custom line item functionality.
    // A good example would be order fulfillment for a line item.
}
add_filter( 'woocommerce_product_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 );
add_filter( 'woocommerce_product_variation_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 );
function custom_get_stock_quantity( $value, $product ) {
    $value = 15; // <== Just for testing
    return $value;
}
add_filter( 'woocommerce_checkout_fields', 'alter_woocommerce_checkout_fields' );

function alter_woocommerce_checkout_fields( $fields ) {

  unset( $fields['billing']['billing_company'] ); // remove the option to enter in a company
  unset( $fields['billing']['billing_address_1'] ); // remove the first line of the address
  unset( $fields['billing']['billing_address_2'] ); // remove the second line of the address
  unset( $fields['billing']['billing_city'] ); // remove the billing city
  unset( $fields['billing']['billing_postcode'] ); // remove the ZIP / postal code field
  unset( $fields['billing']['billing_country'] ); // remove the billing country
  unset( $fields['billing']['billing_state'] ); // remove the billing state
  unset( $fields['billing']['billing_phone'] ); // remove the option to enter in a billing phone number
  unset( $fields['shipping']['shipping_first_name'] );

  unset( $fields['shipping']['shipping_last_name'] );

  unset( $fields['shipping']['shipping_company'] );

  unset( $fields['shipping']['shipping_address_1'] );

  unset( $fields['shipping']['shipping_address_2'] );

  unset( $fields['shipping']['shipping_city'] );

  unset( $fields['shipping']['shipping_postcode'] );

  unset( $fields['shipping']['shipping_country'] );

  unset( $fields['shipping']['shipping_state'] );

  unset( $fields['account']['account_username'] ); // removing this or the two fields below would prevent users from creating an account, which you can do via normal WordPress + Woocommerce capabilities anyway
  unset( $fields['account']['account_password'] );

  unset( $fields['account']['account_password-2'] );

  unset( $fields['order']['order_comments'] ); // removes the order comments / notes field

  return $fields;
}

;
// add a custom Coming Soon page

add_action( 'template_redirect', 'my_custom_coming_soon' );

function my_custom_coming_soon() {

    if( !is_user_logged_in() && !is_page( 'coming-soon' ) ){

        wp_redirect( site_url( 'coming-soon' ) );

        exit();

    }

}


// To disable the coming soon page, just comment out this line by adding // at the start
//add_action( 'template_redirect', 'my_custom_coming_soon' );
Welcome to your new site! Remember Cousett @ Techie Mamma is here to support you.

Need help with your website? Contact <a href="mailto:hellotechiemamma@gmail.com">Techie Mamma</a>!

<a href="http://techiemamma.com">Visit my site</a> for tutorials and all things WordPress, Tech and Mom. Visit the built-in videos for custom videos and basics of WordPress!

Have a new issue or ticket? <a href="https://techiemamma.com/ongoing-support-15-minute-task/" target="_blank" rel="noopener">Submit it and we will get on it right away!</a>
<?php
add_action('admin_init', function () {
    // Redirect any user trying to access comments page
    global $pagenow;
    
    if ($pagenow === 'edit-comments.php') {
        wp_redirect(admin_url());
        exit;
    }
    // Remove comments metabox from dashboard
    remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
    // Disable support for comments and trackbacks in post types
    foreach (get_post_types() as $post_type) {
        if (post_type_supports($post_type, 'comments')) {
            remove_post_type_support($post_type, 'comments');
            remove_post_type_support($post_type, 'trackbacks');
        }
    }
});
// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);
// Hide existing comments
add_filter('comments_array', '__return_empty_array', 10, 2);
// Remove comments page in menu
add_action('admin_menu', function () {
    remove_menu_page('edit-comments.php');
});
// Remove comments links from admin bar
add_action('init', function () {
    if (is_admin_bar_showing()) {
        remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
    }
});
 Save
add_filter( 'mpcs_classroom_style_handles', function( $allowed_handles ) {
  $allowed_handles[] = 'elementor-icons';
  $allowed_handles[] = 'elementor-frontend';
  $allowed_handles[] = 'elementor-post-' . get_the_ID();
  $allowed_handles[] = 'elementor-pro';
  $allowed_handles[] = 'elementor-gallery';
  $allowed_handles[] = 'elementor-icons-fa-solid';
  $allowed_handles[] = 'elementor-icons-fa-brands';
  $allowed_handles[] = 'elementor-icons-fa-regular';
  $allowed_handles[] = 'prismjs_style';
  $allowed_handles[] = 'editor-preview';
  $allowed_handles[] = 'pro-editor-preview';
  $allowed_handles[] = 'flatpickr';
  $allowed_handles[] = 'select2';
  $allowed_handles[] = 'elementor-select2';
  $allowed_handles[] = 'elementor-pro-admin';
  
  return $allowed_handles;
});
/*-----------------------------------------------------------------------------------*/
/*  ACF
/*-----------------------------------------------------------------------------------*/

add_filter('acf/settings/show_admin', '__return_false');
<div class="posts">
            <h2 class="mb-40">
                Recommended Powerlister
            </h2>

            <?php

            $query_args = array(
                'post_type' => 'post',
                'posts_per_page' => 4,
                'meta_key'        => 'show_in_recommended',
                'meta_value'    => '1',
                'orderby'     => 'modified',
                'order'       => 'DESC',
            );

            // The Query
            $the_query = new WP_Query($query_args);

            // The Loop
            if ($the_query->have_posts()) {
                while ($the_query->have_posts()) {

                    $the_query->the_post();
                    $recommended = get_field('show_in_recommended', get_the_ID());



                    $photo = get_field('photo', get_the_ID());
                    $company = get_field('company', get_the_ID());

            ?>

                    <div class="card" style="text-align:left;padding: 0px;width: 100%; margin-left: 4px;">
                        <img src="<?php echo esc_url($photo['url']); ?>" class="card-img-top" alt="...">
                        <div class="card-body">
                            <h2 class="card-title"> <?php the_title(); ?></h2>
                            <p style="font-size: 14px;margin-bottom:0;font-weight: 300;"><?php echo $company; ?></p>
                            <p class="card-text" style="color:#AFAFAF;margin-bottom:0;"><?php echo get_the_date(); ?></p>
                            <a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/arow.png" alt=""></a>
                        </div>
                    </div>
                    <hr>

            <?php

                }
                /* Restore original Post Data */
                wp_reset_postdata();
            } else {
                // no posts found
            }

            ?>



        </div>
<?php

// get the value of image_advanced type of custom field for the current taxonomy term 
$clients_gallery = rwmb_meta( 'clients_gallery', ['object_type' => 'term'], get_queried_object_id() );
// Allow SVG
function allow_svg($mimes)
{
    $mimes['svg'] = 'image/svg+xml';
    $mimes['svgz'] = 'image/svg+xml';
    return $mimes;
}
add_filter('upload_mimes', 'allow_svg');

function fix_mime_type_svg($data = null, $file = null, $filename = null, $mimes = null)
{
    $ext = isset($data['ext']) ? $data['ext'] : '';
    if (strlen($ext) < 1) {
        $exploded=explode('.', $filename);
        $ext=strtolower(end($exploded));
    }
    if ($ext==='svg') {
        $data['type']='image/svg+xml' ;
        $data['ext']='svg' ;
    } elseif ($ext==='svgz') {
        $data['type']='image/svg+xml' ;
        $data['ext']='svgz' ;
    }
    return $data;
}
add_filter('wp_check_filetype_and_ext', 'fix_mime_type_svg', 75, 4);

function fix_svg() {
  echo '<style type="text/css">
        .attachment-266x266, .thumbnail img {
             width: 100% !important;
             height: auto !important;
        }
        </style>';
}
add_action( 'admin_head', 'fix_svg' );
$catlar = get_the_category($ids);
$yayinevi = get_the_terms($ids,"yayinevi");

join(', ', wp_list_pluck($catlar, 'name'));
wp_enqueue_style( 'flickcore', '/wp-content/uploads/flickity/flickity.css' );

wp_enqueue_script( 'flickjs', '/wp-content/uploads/flickity/flickity.pkgd.min.js',array( 'jquery' ),'2.2.1',true);
<?php if( current_user_can('editor') || current_user_can('administrator') ) {  ?>
    // Stuff here for administrators or editors
<?php } ?>
  
  
// If you want to check more than two roles, you can check if the roles of the current user is inside an array of roles, something like:
$user = wp_get_current_user();
$allowed_roles = array('editor', 'administrator', 'author');
<?php if( array_intersect($allowed_roles, $user->roles ) ) {  ?>
   // Stuff here for allowed roles
<?php } ?>
sudo lsof -i:80; sudo lsof -tnP -i:80 | xargs -n 1 ps -p
kill <PID target>
<?php
/**
 * IMPORTANT!!!
 * Before anything else, make sure that you created a custom field for category and has a field called 'custom_order'
 * Then on each catogory, fill out the custom_order field.
 */

/**
* Separate file
* Add a $is_oos_last variable before the woof shortcode then set it to false after the shortcode
*/
?>

<?php $is_oos_last = true; ?>
 <?php echo do_shortcode( '[woof_products per_page="12" columns="3" is_ajax="1"]' ); ?>
<?php $is_oos_last = false; ?>

<?php
/**
* functions.php
* Modify the query to push out of stock at the bottom of the list
*/
add_filter('posts_clauses', 'tbd_order_by_stock_status', 9999);
function tbd_order_by_stock_status($posts_clauses)
{
    global $wpdb;
    global $is_oos_last;

    if ($is_oos_last == 1 || $_GET['is_oos_last'] == 1 || is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() )) {
        $posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
        $posts_clauses['join'] .= " INNER JOIN {$wpdb->prefix}term_relationships term_rel ON {$wpdb->posts}.ID = term_rel.object_id INNER JOIN {$wpdb->prefix}termmeta termmeta1 ON termmeta1.term_id=term_rel.term_taxonomy_id ";
        $posts_clauses['orderby'] = " termmeta1.meta_value ASC, istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
        $posts_clauses['where'] = " AND term_rel.term_taxonomy_id IN (SELECT term_id FROM {$wpdb->prefix}term_taxonomy WHERE taxonomy='product_cat') AND termmeta1.meta_key = 'custom_order' AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
    }
    return $posts_clauses;
}
add_filter('woof_draw_products_get_args', 'tbd_woof_draw_products_get_args', 9999 );
function tbd_woof_draw_products_get_args( $args ) {
    $args['is_oos_last'] = 1;
    return $args;
}
<?php

/**
* Separate file
* Add a $is_oos_last variable before the woof shortcode then set it to false after the shortcode
*/
?>

<?php $is_oos_last = true; ?>
 <?php echo do_shortcode( '[woof_products per_page="12" columns="3" is_ajax="1"]' ); ?>
<?php $is_oos_last = false; ?>

<?php


/**
* functions.php
* Modify the query to push out of stock at the bottom of the list
*/
add_filter('posts_clauses', 'tbd_order_by_stock_status', 9999);
function tbd_order_by_stock_status($posts_clauses)
{
    global $wpdb;
    global $is_oos_last;

    if ($is_oos_last == 1 || $_GET['is_oos_last'] == 1 || is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() )) {
        $posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
        $posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
        $posts_clauses['where'] = " istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
    }
    return $posts_clauses;
}
add_filter('woof_draw_products_get_args', 'tbd_woof_draw_products_get_args', 9999 );
function tbd_woof_draw_products_get_args( $args ) {
    $args['is_oos_last'] = 1;
    return $args;
}
function b2b_redirect_if_product_is_not_for_user() {
    if ( is_product() ) {
        $allowed_user = get_post_meta( get_the_ID(), '_allowed_user', true );
        if ( $allowed_user != get_current_user_id() ) {
            wp_redirect( site_url( '/shop' ), 301 );
        }
    }
}

add_action('template_redirect', 'b2b_redirect_if_product_is_not_for_user');
<?php

add_filter( 'woocommerce_product_query_meta_query', 'show_only_products_with_specific_metakey', 10, 2 );
function show_only_products_with_specific_metakey( $meta_query, $query ) {
    // Only on shop pages
    if( ! is_shop() ) return $meta_query;

    $meta_query[] = array(
        'key'     => '_allowed_user',
        'value'   => get_current_user_id(),
    );
    return $meta_query;
}
<?php

$args = array(
  'role'    => 'customer',
  'orderby' => 'user_nicename',   
  'order'   => 'ASC'
);
$users = get_users( $args );

echo '<ul>';
foreach ( $users as $user ) {
	echo '<li>' . esc_html( $user->display_name ) . '[' . esc_html( $user->user_email ) . ']</li>';
}
echo '</ul>';
<?php

add_filter( 'woocommerce_product_data_tabs', 'b2b_add_user_product_per_user_tab' ); 
function b2b_add_user_product_per_user_tab( $tabs ) {
    $tabs['product-per-user'] = array( 
        'label' => __( 'Assign User', 'woocommerce' ), 
        'target' => 'product_per_user', 
        'class' => array( 'show_if_simple', 'show_if_variable' ), 
    ); 
    return $tabs; 
}

add_action('woocommerce_product_data_panels', 'b2b_product_per_user_panel');
function b2b_product_per_user_panel() {
    global $post;
    // Note the 'id' attribute needs to match the 'target' parameter set above
	?>
    <div id='product_per_user' class='panel woocommerce_options_panel'>
        <?php $redeemable_stores = (array) get_post_meta( $post->ID, '_redeem_in_stores', true );?>
        <p class='form-field _redeem_in_stores'>
            <label for='_redeem_in_stores'><?php _e( 'Redeemable in stores', 'woocommerce' ); ?></label>
            <select name='_redeem_in_stores[]' class='wc-enhanced-select' multiple='multiple' style='width: 80%;'>
                <option <?php selected( in_array( 'AL', $redeemable_stores ) ); ?> value='AL'>Alabama</option>
                <option <?php selected( in_array( 'NY', $redeemable_stores ) ); ?> value='NY'>New York</option>
                <option <?php selected( in_array( 'TX', $redeemable_stores ) ); ?> value='TX'>Texas</option>
                <option <?php selected( in_array( 'WY', $redeemable_stores ) ); ?> value='WY'>Wyoming</option>
            </select>
            <img class='help_tip' data-tip="<?php _e( 'Select the stores where this gift card is redeemable.', 'woocommerce' ); ?>" src='<?php echo esc_url( WC()->plugin_url() ); ?>/assets/images/help.png' height='16' width='16'>
        </p>
    </div>
    <?php
}

/**
 * Save the custom fields.
 */
function save_product_per_user_field( $post_id ) {
	if ( isset( $_POST['_redeem_in_stores'] ) ) :
		update_post_meta( $post_id, '_redeem_in_stores', (array) $_POST['_redeem_in_stores'] );
	endif;
}
add_action( 'woocommerce_process_product_meta_simple', 'save_product_per_user_field' );
add_action( 'woocommerce_process_product_meta_variable', 'save_product_per_user_field' );
wp_register_script( 'jQuery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js', null, null, true );
wp_enqueue_script('jQuery');
wp_register_style( 'Font_Awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );
wp_enqueue_style('Font_Awesome');
/**
* Usage [gift_registry_search_form]
*/
add_shortcode( 'gift_registry_search_form', 'gift_registry_search_form' );
function gift_registry_search_form( $atts )
{
    ob_start();
    ?>
        <div class="gift-registry-search-form">
            <h1>Find a Gift Registry</h1>
            <input type="text" name="gift_registry_first_name" id="gift_registry_first_name" placeholder="Search by first name" />
            <input type="text" name="gift_registry_last_name" id="gift_registry_last_name" placeholder="Search by last name" />
            <input type="text" name="gift_registry_email" id="gift_registry_email" placeholder="Search by email" />
            <button class="search-registry-button">Search</button>
        </div>
    <?php
    $output = ob_get_contents();
    ob_end_clean();

    return $output;
}
<?php

add_action( 'init', 'overrides', 1 );

public function overrides()
{
    global $wp_filter;
    
    // get all callbacks from the hook 'woocommerce_account_gift_registry_endpoint' with a priority of 10
    foreach ($wp_filter['woocommerce_account_gift_registry_endpoint']->callbacks[10] as $callback_function => $registration ) {
    	// check if the callback function contains the hooked method class
        if ( strpos( $callback_function, 'addify_gift_registry_endpoint_content', 32) !== false) {
            remove_action( 'woocommerce_account_gift_registry_endpoint', $callback_function, 10 );
            
            // override the default function of the hook to the function 'my_custom_func'
            add_action( 'woocommerce_account_gift_registry_endpoint', 'my_custom_func', 10 );
           	// re-route which hook should the callback function run
            add_action( 'woocommerce_account_another_endpoint', $callback_function, 10 );
        }
    }
}
@media (max-width: 980px) {
.forceRowOrder {
	display: flex;
  flex-wrap: wrap;
}

.Order1 {
	order: 1;
	margin-bottom: 30px !important;
}

.Order2 {
	order: 2;
	margin-bottom: 0px !important;
}
}
<?php
 /*
 Plugin Name: Disable Smart Quotes
 Plugin URI:
 Description: Disable curly smart quotes in post content, comment and title.
 Version: 1.0
 Author: WebNots
 Author URI: https://www.webnots.com
 */
 remove_filter('the_content', 'wptexturize');
 remove_filter('comment_text', 'wptexturize');
 remove_filter('the_title', 'wptexturize');
 ?>
define('FS_METHOD', 'direct');
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true);
<?php $recent = new WP_Query("posts_per_page=-1&cat=26&orderby=title&order=ASC");
                    while ($recent->have_posts()) : $recent->the_post(); ?>
                        <div class="col-sm-5 col-md-3">
                            <div class="thumbnail" style="text-align:center;">
                                <a class="logosSocios" target="_blank" href="<?php the_field('enlace') ?>"><span><?php the_post_thumbnail('', ['class' => 'img-responsive center-block']); ?></span></a>
                                <div class="caption">
                                    <!-- <h4><?php the_title(); ?></h4> -->
                                    <a class="btn btn-primary btn-socios" style="color: white; border-color: #fff;" href="<?php the_field('enlace') ?>" target="_blank" rel="noopener noreferrer"><?php the_title(); ?></a>
                                </div>
                            </div>
                        </div>
                    <?php endwhile;
                    wp_reset_query(); ?>
<!--la ruta absoluta-->
<img src="<?php echo get_bloginfo('wpurl');?>/wp-content/themes/temacreado/img/w.logo.png" alt="">
<!--
<?php echo get_bloginfo('wpurl');?> nos da la ruta de: http://localhost/cliente/  la ruta del archivo que tiene todo el wordpress dentro.
-->   
  
<!--La ruta relativa-->
<img src="wp-content/themes/temacreado/img/w.logo.png" alt="">
<!--
solo es la ruta relativa que es segun la ubicación del archivo
pero como los dos archivos se crean con page.php solo la portada es direccionada adecuadamente con esa direción relativa. lo que las paginas(no portada)  no lo reconocen; por eso la nececidad de dar la pocición absoluta.
-->

  <!-- Nos dimos cuenta que -->
  
/* Make Elementor elements expand to fit the full available width - due to how EL puts padding
all the way round columns */
.elementor-section-boxed .elementor-column-gap-default > .elementor-row {
    width: calc(100% + 20px);
    margin-left: -10px;
    margin-right: -10px;
}
.elementor-section-boxed .elementor-column-gap-narrow > .elementor-row {
    width: calc(100% + 10px);
    margin-left: -5px;
    margin-right: -5px;
}
.elementor-section-boxed .elementor-column-gap-extended > .elementor-row {
    width: calc(100% + 30px);
    margin-left: -15px;
    margin-right: -15px;
}
.elementor-section-boxed .elementor-column-gap-wide > .elementor-row {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
}
.elementor-section-boxed .elementor-column-gap-wider > .elementor-row {
    width: calc(100% + 60px);
    margin-left: -30px;
    margin-right: -30px;
}
if ( ! function_exists( 'is_shop' ) ) :
    function is_shop() {
        //your codes goes here. 
    }
endif; 
UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');
UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');
/* No-index posts older than 90 days if in PR custom post type */

function noindexOldPRs() {
	$url = 'http://' . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ];
	$current_post_id = url_to_postid( $url );
	
	$publishdate = get_the_time('Y-m-d', $current_post_id);
	$posttype = get_post_type ($current_post_id);
	
	if ($posttype == "pr") {
		$ninetydaysago = date("Y-m-d", strtotime("-90 days"));
		if($publishdate < $ninetydaysago) {
			echo '<meta name="robots" content="noindex">';
		}
	} elseif (has_tag('nonnews', $current_post_id)) {
		echo '<meta name="Googlebot-News" content="noindex, nofollow">';
	}
	
	//add noindex/nofollow for google news bot
	// get tags
	// if a tag includes nonnews
	// then add
	// <meta name="Googlebot-News" content="noindex, nofollow">

}
add_action('wp_head', 'noindexOldPRs');
.wpcf7 input,
.wpcf7 textarea,
.wpcf7 input[type="submit"] {
transition: 0.3s ease-in-out all
}

.wpcf7 input:not([type="submit"]),
.wpcf7 textarea {
width: 100%;
}

.wpcf7 input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]),
.wpcf7 textarea {
border-width: 0 0 2px;
border-color: #41506DFF;
border-style: solid;
background-color: #FFFFFFFF;
padding: 8px;
color: #3F3F3F;
margin-bottom:20px;
}

.wpcf7 input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus,
.wpcf7 textarea:focus {
border-width: 0 0 2px;
border-color: #41506D;
border-style: none;
background-color: #FFFFFFFF;
box-shadow: 0px 0px 13px #00000024;
}
.wpcf7 label {
font-size:16px;
font-weight:600;
color:#41506D;
}
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
font-size:16px;
font-weight:600;
color:#000000;
}
.wpcf7 input[type="submit"] {
font-size:16px;
font-weight:600;
color:#FFFFFF;
background-color:#41506D;
padding:16px 40px;
height: auto;
display: block;
width: 100%;
max-width: 100%;
border-radius: 30px;
}
.wpcf7 input[type="submit"]:hover {
color:#FFFFFFFF;
background-color:#6A82A6FF;
box-shadow: 0px 12px 33px #00000055;
border-radius: 30px;
}
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES HEADER CACHING ##
remove_theme_support(  'block-templates' );
// hoja css
wp_enqueue_style( 'tema_fray_framework', get_template_directory_uri().'/css/fray.css',array(),time());
// hoja Js
wp_enqueue_script( 'tema_fray_js', get_template_directory_uri() . '/js/misfunciones.js', array(),time(),true);

// true: carga el js en el footer
// false(por defecto): carga el js en el head
// Nota: "las hojas css(estilo), se deben cargar en el head(defaul o false)" 
wp search-replace '<script async\s*.*>\s*.*<\/script>' '' wp_posts --regex --allow-root
if ( ! defined( 'WPINC' ) ) {
	die;
}

add_action( 'wp_enqueue_scripts', 'custom_enqueue_files' );
/**
 * Loads <list assets here>.
 */
function custom_enqueue_files() {
	// if this is not the front page, abort.
	// if ( ! is_front_page() ) {
	// 	return;
	// }

	// loads a CSS file in the head.
	// wp_enqueue_style( 'highlightjs-css', plugin_dir_url( __FILE__ ) . 'assets/css/style.css' );

	/**
	 * loads JS files in the footer.
	 */
	// wp_enqueue_script( 'highlightjs', plugin_dir_url( __FILE__ ) . 'assets/js/highlight.pack.js', '', '9.9.0', true );

	// wp_enqueue_script( 'highlightjs-init', plugin_dir_url( __FILE__ ) . 'assets/js/highlight-init.js', '', '1.0.0', true );
}
jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function
    [ your code goes here ]
} );
//set up load.php inside /wp-content/mu-plugins, then add:
require(WPMU_PLUGIN_DIR . '/myplugin/myplugin.php');

//OR –– use below for multiple mu-plugins inside a subdirectory
//
// Opens the must-use plugins directory
$wpmu_plugin_dir = opendir(WPMU_PLUGIN_DIR);

// Lists all the entries in this directory
while (false !== ($entry = readdir($wpmu_plugin_dir))) {
$path = WPMU_PLUGIN_DIR . '/' . $entry;

// Is the current entry a subdirectory?
if ($entry != '.' && $entry != '..' && is_dir($path)) {
// Includes the corresponding plugin
require($path . '/' . $entry . '.php');
}
}

// Closes the directory
closedir($wpmu_plugin_dir);
<?php
/**
 * Gutenberg Examples Stylesheets
 */
 
function gutenberg_examples_02_register_block() {
    wp_register_script(
        'gutenberg-examples-02',
        plugins_url( 'block.js', __FILE__ ),
        array( 'wp-blocks', 'wp-element' ),
        filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
    );
 
    wp_register_style(
        'gutenberg-examples-02-editor',
        plugins_url( 'editor.css', __FILE__ ),
        array( 'wp-edit-blocks' ),
        filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
    );
 
    wp_register_style(
        'gutenberg-examples-02',
        plugins_url( 'style.css', __FILE__ ),
        array( ),
        filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
    );
 
    // Allow inlining small stylesheets on the frontend if possible.
    wp_style_add_data( 'gutenberg-examples-02', 'path', dirname( __FILE__ ) . '/style.css' );
 
    register_block_type( 'gutenberg-examples/example-02-stylesheets', array(
        'api_version' => 2,
        'style' => 'gutenberg-examples-02',
        'editor_style' => 'gutenberg-examples-02-editor',
        'editor_script' => 'gutenberg-examples-02',
    ) );
}
add_action( 'init', 'gutenberg_examples_02_register_block' );
$ npx @wordpress/create-block [options] [slug]
.oxygen-body{
  /* Full width styling for Oxygen Gutenberg blocks and Gutenberg images*/
  width:100vw;
  overflow-x:hidden;
}

.alignfull {
    margin-left  : calc( -100vw / 2 + 100% / 2 );
    margin-right : calc( -100vw / 2 + 100% / 2 );
    max-width    : 100vw;
}
//disable post revisions
//define('WP_POST_REVISIONS', false );

//limit post revisions
define('WP_POST_REVISIONS', 3);

//enable debug log
//define( 'WP_DEBUG_LOG', true );

//output debug log
//define( 'WP_DEBUG_DISPLAY', true );
// Place in wp-config
// removing the edit_themes, edit_plugins, and edit_files capabilities for all users
define('DISALLOW_FILE_EDIT', true);

// disable theme updates and new plugins 
// define('DISALLOW_FILE_MODS', true);
<?php

/**
 * Add required plugins to WDS_Required_Plugins.
 *
 * @param  array $required Array of required plugins in `plugin_dir/plugin_file.php` form.
 *
 * @return array           Modified array of required plugins.
 */
function wds_required_plugins_add( $required ) {

	$required = array_merge( $required, array(
		'jetpack/jetpack.php',
		'sample-plugin/sample-plugin.php',
	) );

	return $required;
}
add_filter( 'wds_required_plugins', 'wds_required_plugins_add' );

// for network activated plugins
// add_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );


/**
 * Modify the required-plugin label.
 *
 * @param  string  $label Label markup.
 *
 * @return string         (modified) label markup.
 */
function change_wds_required_plugins_text( $label ) {

	$label_text = __( 'Required Plugin for ACME', 'acme-prefix' );
	$label = sprintf( '<span style="color: #888">%s</span>', $label_text );

	return $label;
}
add_filter( 'wds_required_plugins_text', 'change_wds_required_plugins_text' );

// To hide required plugins
// add_filter( 'wds_required_plugins_remove_from_list', '__return_true' );

// Add custom dashboard logo
add_action('admin_head', 'my_custom_logo');
  
function my_custom_logo() {
echo '
<style type="text/css">
#header-logo { background-image: url('.get_bloginfo('template_directory').'/img/logo.jpg) !important; }
</style>
';
}
/*
 * Function for post duplication. Dups appear as drafts. User is redirected to the edit screen
 */
function rd_duplicate_post_as_draft(){
  global $wpdb;
  if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {
    wp_die('No post to duplicate has been supplied!');
  }
 
  /*
   * Nonce verification
   */
  if ( !isset( $GET['duplicate_nonce'] ) || !wp_verify_nonce( $_GET['duplicate_nonce'], basename( __FILE_ ) ) )
    return;
 
  /*
   * get the original post id
   */
  $post_id = (isset($_GET['post']) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
  /*
   * and all the original post data then
   */
  $post = get_post( $post_id );
 
  /*
   * if you don't want current user to be the new post author,
   * then change next couple of lines to this: $new_post_author = $post->post_author;
   */
  $current_user = wp_get_current_user();
  $new_post_author = $current_user->ID;
 
  /*
   * if post data exists, create the post duplicate
   */
  if (isset( $post ) && $post != null) {
 
    /*
     * new post data array
     */
    $args = array(
      'comment_status' => $post->comment_status,
      'ping_status'    => $post->ping_status,
      'post_author'    => $new_post_author,
      'post_content'   => $post->post_content,
      'post_excerpt'   => $post->post_excerpt,
      'post_name'      => $post->post_name,
      'post_parent'    => $post->post_parent,
      'post_password'  => $post->post_password,
      'post_status'    => 'draft',
      'post_title'     => $post->post_title,
      'post_type'      => $post->post_type,
      'to_ping'        => $post->to_ping,
      'menu_order'     => $post->menu_order
    );
 
    /*
     * insert the post by wp_insert_post() function
     */
    $new_post_id = wp_insert_post( $args );
 
    /*
     * get all current post terms ad set them to the new post draft
     */
    $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array("category", "post_tag");
    foreach ($taxonomies as $taxonomy) {
      $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));
      wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);
    }
 
    /*
     * duplicate all post meta just in two SQL queries
     */
    $post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id");
    if (count($post_meta_infos)!=0) {
      $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
      foreach ($post_meta_infos as $meta_info) {
        $meta_key = $meta_info->meta_key;
        if( $meta_key == '_wp_old_slug' ) continue;
        $meta_value = addslashes($meta_info->meta_value);
        $sql_query_sel[]= "SELECT $new_post_id, '$meta_key', '$meta_value'";
      }
      $sql_query.= implode(" UNION ALL ", $sql_query_sel);
      $wpdb->query($sql_query);
    }
 
 
    /*
     * finally, redirect to the edit post screen for the new draft
     */
    wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );
    exit;
  } else {
    wp_die('Post creation failed, could not find original post: ' . $post_id);
  }
}
add_action( 'admin_action_rd_duplicate_post_as_draft', 'rd_duplicate_post_as_draft' );
 
/*
 * Add the duplicate link to action list for post_row_actions
 */
function rd_duplicate_post_link( $actions, $post ) {
  if (current_user_can('edit_posts')) {
    $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=rd_duplicate_post_as_draft&post=' . $post->ID, basename(_FILE_), 'duplicate_nonce' ) . '" title="שכפל דף/פוסט זה" rel="permalink">שכפל דף/פוסט</a>';
  }
  return $actions;
}
 
add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );

add_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2);
/*** Adds SKUs and product images to WooCommerce order emails */ 
function sww_add_sku_to_wc_emails( $args ) { $args['show_sku'] = true; return $args; } add_filter( 'woocommerce_email_order_items_args', 'sww_add_sku_to_wc_emails' );
/*** Adds product images to WooCommerce order emails */
function sww_add_photos_to_wc_emails( $args ) { $args['show_image'] = true; return $args; } add_filter( 'woocommerce_email_order_items_args', 'sww_add_photos_to_wc_emails' );
function overrule_webhook_disable_limit( $number ) {

    return 999999999999; //very high number hopefully you'll never reach.

}

add_filter( 'woocommerce_max_webhook_delivery_failures', 'overrule_webhook_disable_limit' );
add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );
 
function wpb_stop_update_emails( $send, $type, $core_update, $result ) {
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
return true;
}
/* DISABLE GUTENBERG EDITOR */
// disable for posts
add_filter('use_block_editor_for_post', '__return_false');

// disable for post types
add_filter('use_block_editor_for_post_type', '__return_false');

/* END DISABLE GUTENBERG EDITOR */ 
# There are a few ways to change the url in wordpress


# The prefered method is the wp-cli via search-replace.
$ wp search-replace 'http://example.test' 'http://example.com' --skip-columns=guid

# You can also test with a dry run
$ wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run


# If the wp-cli is not available or you can't use SSH there are three other ways to try inside the files wp-config and functions.php

# At the beginning of wp-config.php, add
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );

# At the end of the file, before the comment to stop editing here, you can set the relocate method. This always takes the current url calling "/wp-login.php" as slug as site url.
define('RELOCATE',true);

# Inside funcions.php, as first call, you can set
update_option( 'siteurl', 'http://example.com');
update_option( 'home', 'http://example.com');

# Use Plugin

The plugin 'Better search replace' is also able to change the links in the database quite easily.


# As last resort, you can change the database values manually.You will have to look for "siteurl" in the table "wp_options" and change the values to the correct url.

# After changing the url, don't forget to remove the above settings again. Move to your settings in the backend and check the url. Also, inside the options section, look for "permalinks". It will bring you to an options page where you can regenerate the dynamic links. Without this regenerating, links for assets, media files and so an would possibly keep pointing to the old url. 
WPDBNAME=`cat wp-config.php | grep DB_NAME | cut -d \' -f 4`
WPDBUSER=`cat wp-config.php | grep DB_USER | cut -d \' -f 4`
WPDBPASS=`cat wp-config.php | grep DB_PASSWORD | cut -d \' -f 4`
// Exclude certain pages from WordPress search results
//======================================
function jp_search_filter( $query ) {
  if ( ! $query->is_admin && $query->is_search && $query->is_main_query() ) {
    $query->set( 'post__not_in', array( 827,851 ) );
  }
}
add_action( 'pre_get_posts', 'jp_search_filter' );
//add allowable file types to wordpress media uploader
function custom_mime_types( $mimes ){
	$mimes['vcf'] = 'text/vcard'; //allowing .cvf filetypes
//additional filetypes can go here
	return $mimes;
}
add_filter( 'upload_mimes', 'custom_mime_types' );
add_action( 'woocommerce_after_add_to_cart_quantity', 'ts_quantity_plus_sign' );

function ts_quantity_plus_sign() {
echo '<button type="button" class="plus" >+</button>';
}

add_action( 'woocommerce_before_add_to_cart_quantity', 'ts_quantity_minus_sign' );

function ts_quantity_minus_sign() {
echo '<button type="button" class="minus" >-</button>';
}

add_action( 'wp_footer', 'ts_quantity_plus_minus' );

function ts_quantity_plus_minus() {
// To run this on the single product page
if ( ! is_product() ) return;
?>
<script type="text/javascript">

jQuery(document).ready(function($){

$('form.cart').on( 'click', 'button.plus, button.minus', function() {

// Get current quantity values
var qty = $( this ).closest( 'form.cart' ).find( '.qty' );
var val = parseFloat(qty.val());
var max = parseFloat(qty.attr( 'max' ));
var min = parseFloat(qty.attr( 'min' ));
var step = parseFloat(qty.attr( 'step' ));

// Change the value if plus or minus
if ( $( this ).is( '.plus' ) ) {
if ( max && ( max <= val ) ) {
qty.val( max );
}
else {
qty.val( val + step );
}
}
else {
if ( min && ( min >= val ) ) {
qty.val( min );
}
else if ( val > 1 ) {
qty.val( val - step );
}
}

});

});

</script>
<?php
}
// remove wp version number from head and rss
function artisansweb_remove_version() {
    return '';
}
add_filter('the_generator', 'artisansweb_remove_version');
// remove wp version number from scripts and styles
function remove_css_js_version( $src ) {
    if( strpos( $src, '?ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
add_filter( 'style_loader_src', 'remove_css_js_version', 9999 );
add_filter( 'script_loader_src', 'remove_css_js_version', 9999 );
//*****---   Remove Gutenberg Block Library CSS from loading on the frontend  ---*****
//===================================================================
function smartwp_remove_wp_block_library_css(){
 wp_dequeue_style( 'wp-block-library' );
 wp_dequeue_style( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css' );
//*****---  Remove Eicons:  ---*****
//==========================
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 ); 
function remove_default_stylesheet() { 
	wp_deregister_style( 'elementor-icons' ); 
}
//******--- Remove Font Awesome ---*****
//===============================
add_action( 'elementor/frontend/after_register_styles',function() {
	foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
		wp_deregister_style( 'elementor-icons-fa-' . $style );
	}
}, 20 );
******--- Remove Google Fonts ---******
//===============================
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
/***** Allow SVG *****/
//===================
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {

  global $wp_version;
  if ( $wp_version !== '4.7.1' ) {
     return $data;
  }

  $filetype = wp_check_filetype( $filename, $mimes );

  return [
      'ext'             => $filetype['ext'],
      'type'            => $filetype['type'],
      'proper_filename' => $data['proper_filename']
  ];

}, 10, 4 );

function cc_mime_types( $mimes ){
  $mimes['svg'] = 'image/svg+xml';
  return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );

function fix_svg() {
  echo '<style type="text/css">
        .attachment-266x266, .thumbnail img {
             width: 100% !important;
             height: auto !important;
        }
        </style>';
}
add_action( 'admin_head', 'fix_svg' );
/***** Shorten Post/Page link  *****/
//============================
add_filter( 'get_shortlink', function ( $shortlink ) {
    return $shortlink;
});
// disable gutenberg  for posts
//========================
add_filter('use_block_editor_for_post', '__return_false', 10);

// disable gutenberg  for post types
//===========================
add_filter('use_block_editor_for_post_type', '__return_false', 10);
// Set WooCommerce Virtual Order Status to Complete After Payment
add_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 2 );
function virtual_order_payment_complete_order_status( $order_status, $order_id ) {
  $order = new WC_Order( $order_id );
  if ( 'processing' == $order_status &&
       ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) {
    $virtual_order = null;
    if ( count( $order->get_items() ) > 0 ) {
      foreach( $order->get_items() as $item ) {
        if ( 'line_item' == $item['type'] ) {
          $_product = $order->get_product_from_item( $item );
          if ( ! $_product->is_virtual() ) {
            // once we've found one non-virtual product we know we're done, break out of the loop
            $virtual_order = false;
            break;
          } else {
            $virtual_order = true;
          }
        }
      }
    }
    // virtual order, mark as completed
    if ( $virtual_order ) {
      return 'completed';
    }
  }
  // non-virtual order, return original status
  return $order_status;
}
add_filter( 'woocommerce_default_address_fields' , 'custom_override_postcode_validation' );
 
function custom_override_postcode_validation( $address_fields ) {
  $address_fields['postcode']['required'] = false;
  return $address_fields;
}
function search_by_sku( $search, &$query_vars ) {
    global $wpdb;
    if(isset($query_vars->query['s']) && !empty($query_vars->query['s'])){
        $args = array(
            'posts_per_page'  => -1,
            'post_type'       => 'product',
            'meta_query' => array(
                array(
                    'key' => '_sku',
                    'value' => $query_vars->query['s'],
                    'compare' => 'LIKE'
                )
            )
        );
        $posts = get_posts($args);
        if(empty($posts)) return $search;
        $get_post_ids = array();
        foreach($posts as $post){
            $get_post_ids[] = $post->ID;
        }
        if(sizeof( $get_post_ids ) > 0 ) {
                $search = str_replace( 'AND (((', "AND ((({$wpdb->posts}.ID IN (" . implode( ',', $get_post_ids ) . ")) OR (", $search);
        }
    }
    return $search;
    
}
    add_filter( 'posts_search', 'search_by_sku', 999, 2 );
add_filter( 'woocommerce_default_address_fields' , 'QuadLayers_optional_postcode_checkout' );
function QuadLayers_optional_postcode_checkout( $p_fields ) {
$p_fields['postcode']['required'] = false;
return $p_fields;
}
// Disable support for comments and trackbacks in post types
function sv_disable_comments_post_types_support() {
	$post_types = get_post_types();
	foreach ($post_types as $post_type) {
		if(post_type_supports($post_type, 'comments')) {
			remove_post_type_support($post_type, 'comments');
			remove_post_type_support($post_type, 'trackbacks');
		}
	}
}
add_action('admin_init', 'sv_disable_comments_post_types_support');



// Close comments on the front-end
function sv_disable_comments_status() {
	return false;
}
add_filter('comments_open', 'sv_disable_comments_status', 20, 2);
add_filter('pings_open', 'sv_disable_comments_status', 20, 2);



// Hide existing comments
function sv_disable_comments_hide_existing_comments($comments) {
	$comments = array();
	return $comments;
}
add_filter('comments_array', 'sv_disable_comments_hide_existing_comments', 10, 2);



// Remove comments page in menu
function sv_disable_comments_admin_menu() {
	remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'sv_disable_comments_admin_menu');



// Redirect any user trying to access comments page
function sv_disable_comments_admin_menu_redirect() {
	global $pagenow;
	if ($pagenow === 'edit-comments.php') {
		wp_redirect(admin_url()); exit;
	}
}
add_action('admin_init', 'sv_disable_comments_admin_menu_redirect');



// Remove comments metabox from dashboard
function sv_disable_comments_dashboard() {
	remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'sv_disable_comments_dashboard');



// Remove comments links from admin bar
function sv_disable_comments_admin_bar() {
	if (is_admin_bar_showing()) {
		remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
	}
}
add_action('init', 'sv_disable_comments_admin_bar');
// Automatically set the image Title, Alt-Text, Caption & Description upon upload
add_action( 'add_attachment', 'my_set_image_meta_upon_image_upload' );
function my_set_image_meta_upon_image_upload( $post_ID ) {
 
    // Check if uploaded file is an image, else do nothing
 
    if ( wp_attachment_is_image( $post_ID ) ) {
 
        $my_image_title = get_post( $post_ID )->post_title;
 
        // Sanitize the title:  remove hyphens, underscores & extra spaces:
        $my_image_title = preg_replace( '%\s*[-_\s]+\s*%', ' ',  $my_image_title );
 
        // Sanitize the title:  capitalize first letter of every word (other letters lower case):
        $my_image_title = ucwords( strtolower( $my_image_title ) );
 
        // Create an array with the image meta (Title, Caption, Description) to be updated
        // Note:  comment out the Excerpt/Caption or Content/Description lines if not needed
        $my_image_meta = array(
            'ID'        => $post_ID,            // Specify the image (ID) to be updated
            'post_title'    => $my_image_title,     // Set image Title to sanitized title
            'post_excerpt'  => $my_image_title,     // Set image Caption (Excerpt) to sanitized title
            'post_content'  => $my_image_title,     // Set image Description (Content) to sanitized title
        );
 
        // Set the image Alt-Text
        update_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );
 
        // Set the image meta (e.g. Title, Excerpt, Content)
        wp_update_post( $my_image_meta );
 
    } 
}
add_action( 'wp_body_open', 'wpdoc_add_custom_body_open_code' );
 
function wpdoc_add_custom_body_open_code() {
    echo '<!-- Google Tag Manager (noscript) --> ... <!-- End Google Tag Manager (noscript) -->';
}
server {
  ...
    location /wp {
        alias /home/user/www/.../wordpress/;
        index index.php index.html index.htm;
        try_files $uri $uri/ /wp/index.php?$is_args$args;
    }
    location ~ \.php$ {
        root /home/user/www/.../wordpress/;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^/wp(/.+\.php)(.*)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

  ...
}
//This code prevents noreferrer from being added to new or updated posts
function im_targeted_link_rel($rel_values) {
return 'noopener';
}
add_filter('wp_targeted_link_rel', 'im_targeted_link_rel',999);
//add aria label to link that opens in new tab
function aria_formatter($content) {
$replace = array('target="_blank"' => 'target="_blank" aria-label="Opens in a new tab."');
$new_content = strtr($content, $replace);
return $new_content;
}
add_filter('the_content', 'aria_formatter', 999);
<script>
jQuery( document ).ready(function($){
	$(document).on('click','.elementor-location-popup a', function(event){
		elementorProFrontend.modules.popup.closePopup( {}, event);
	})
});
</script>
The 'tax_query' clauses can be nested, to create more complex queries. Example: Display posts that are in the quotes category OR both have the quote post format AND are in the wisdom category:

$args = array(
	'post_type' => 'post',
	'tax_query' => array(
		'relation' => 'OR',
		array(
			'taxonomy' => 'category',
			'field'    => 'slug',
			'terms'    => array( 'quotes' ),
		),
		array(
                        'relation' => 'AND',
                        array(
			        'taxonomy' => 'post_format',
			        'field'    => 'slug',
			        'terms'    => array( 'post-format-quote' ),
                        ),
                        array(
                                'taxonomy' => 'category',
                                'field'    => 'slug',
                                'terms'    => array( 'wisdom' ),
                        ),
		),
	),
);
$query = new WP_Query( $args );

Display posts from several custom taxonomies:

$args = array(
	'post_type' => 'post',
	'tax_query' => array(
		'relation' => 'AND',
		array(
			'taxonomy' => 'movie_genre',
			'field'    => 'slug',
			'terms'    => array( 'action', 'comedy' ),
		),
		array(
			'taxonomy' => 'actor',
			'field'    => 'term_id',
			'terms'    => array( 103, 115, 206 ),
			'operator' => 'NOT IN',
		),
	),
);
$query = new WP_Query( $args );
Simple Taxonomy Query:

Display posts tagged with bob, under people custom taxonomy:

$args = array(
	'post_type' => 'post',
	'tax_query' => array(
		array(
			'taxonomy' => 'people',
			'field'    => 'slug',
			'terms'    => 'bob',
		),
	),
);
$query = new WP_Query( $args );
<?php

add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');

function my_theme_enqueue_styles()
{
    wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
    wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style'));
    wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/path/to/script.js', '', '', true );
}
[trp_language language="en_US"]

 //Add custom HTML for the English here

[/trp_language]

[trp_language language="fr_FR"]

 //Add custom HTML for the French here

[/trp_language]
star

Tue May 14 2024 22:39:20 GMT+0000 (Coordinated Universal Time) https://css-tricks.com/snippets/wordpress/year-shortcode/

#php #wordpress
star

Thu Feb 22 2024 22:13:54 GMT+0000 (Coordinated Universal Time)

#wordpress #dashboard #dark-mode
star

Mon Feb 12 2024 13:58:13 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Mon Feb 12 2024 07:55:29 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Fri Jan 19 2024 06:43:01 GMT+0000 (Coordinated Universal Time)

#woocommerce #wordpress
star

Mon Dec 11 2023 14:02:36 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Mon Dec 11 2023 14:02:34 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Tue Oct 31 2023 10:45:29 GMT+0000 (Coordinated Universal Time)

#wordpress #elementor
star

Wed Sep 06 2023 08:31:13 GMT+0000 (Coordinated Universal Time) https://blog.wplauncher.com/creating-wordpress-rss-feeds-for-custom-post-types/

#wordpress #rss
star

Mon Jul 31 2023 11:38:42 GMT+0000 (Coordinated Universal Time) https://crocoblock.com/knowledge-base/jetengine/jetengine-how-to-display-media-files-with-dynamic-repeater-widget/

#wordpress
star

Wed Jun 14 2023 23:12:01 GMT+0000 (Coordinated Universal Time)

#wordpress #docker-compose
star

Thu Jun 08 2023 14:34:22 GMT+0000 (Coordinated Universal Time)

#wordpress #config #nginx #apache #php
star

Fri May 12 2023 14:42:36 GMT+0000 (Coordinated Universal Time) https://romanmiranda.com/wordpress-snippet-change-users-role-by-username/

#php #wordpress
star

Fri May 12 2023 13:52:53 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Tue Mar 28 2023 15:45:00 GMT+0000 (Coordinated Universal Time)

#php #wordpress #facetwp
star

Mon Mar 27 2023 08:33:41 GMT+0000 (Coordinated Universal Time)

#docker #wordpress
star

Mon Mar 27 2023 08:29:05 GMT+0000 (Coordinated Universal Time)

#docker #wordpress
star

Mon Mar 27 2023 08:28:32 GMT+0000 (Coordinated Universal Time)

#docker #wordpress
star

Sun Mar 26 2023 05:01:38 GMT+0000 (Coordinated Universal Time)

#docker #wordpress
star

Sat Feb 11 2023 11:39:16 GMT+0000 (Coordinated Universal Time)

#wordpress #debug
star

Sun Feb 05 2023 05:26:55 GMT+0000 (Coordinated Universal Time)

#html #wordpress
star

Tue Jan 10 2023 12:59:56 GMT+0000 (Coordinated Universal Time) https://london.wordcamp.org/2015/wapuunk-wallpapers-and-more/

#wordpress #wapuu #wapuunk
star

Sun Nov 06 2022 06:31:32 GMT+0000 (Coordinated Universal Time)

#wordpress
star

Sun Nov 06 2022 06:12:50 GMT+0000 (Coordinated Universal Time)

#wordpress
star

Sun Nov 06 2022 06:07:42 GMT+0000 (Coordinated Universal Time)

#wordpress
star

Tue Oct 25 2022 21:42:27 GMT+0000 (Coordinated Universal Time) https://webdesign.tutsplus.com/es/tutorials/loading-css-into-wordpress-the-right-way--cms-20402

#wordpress
star

Thu Oct 06 2022 14:14:40 GMT+0000 (Coordinated Universal Time) https://plusmall.net/wp-admin/admin.php?page

#wordpress
star

Thu Sep 08 2022 08:24:18 GMT+0000 (Coordinated Universal Time) https://itsmereal.com/advanced-custom-fields-conditional-required-field/

#wordpress #acf #require #field #conditionally #filter
star

Mon Aug 29 2022 12:01:25 GMT+0000 (Coordinated Universal Time)

#wordpress #htaccess #apache2
star

Thu Aug 25 2022 11:04:40 GMT+0000 (Coordinated Universal Time) https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker

#css #php #wordpress
star

Mon Aug 22 2022 09:07:31 GMT+0000 (Coordinated Universal Time) https://themeisle.com/blog/hide-wordpress-admin-bar/#specific-user-roles

#wordpress #adminbar
star

Fri Aug 12 2022 01:01:35 GMT+0000 (Coordinated Universal Time) https://docs.metabox.io/displaying-fields-with-code/

#wordpress #php #metabox
star

Thu Aug 11 2022 23:37:20 GMT+0000 (Coordinated Universal Time)

#wordpress #php
star

Thu Aug 11 2022 23:11:14 GMT+0000 (Coordinated Universal Time)

#wordpress #php
star

Thu Aug 11 2022 20:57:16 GMT+0000 (Coordinated Universal Time)

#wordpress #html
star

Wed Aug 10 2022 09:53:31 GMT+0000 (Coordinated Universal Time) https://casabona.org/2014/12/add-attachments-wordpress-search-results/

#wordpress #search #attachments
star

Mon Aug 08 2022 04:46:18 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/plugins/plugin-basics/header-requirements/

#php #email #form #wordpress #header
star

Tue Jun 28 2022 12:39:20 GMT+0000 (Coordinated Universal Time) https://websensepro.com/blog/how-to-embed-pdf-in-elementor-without-any-plugin/

#embed-pdf #wordpress #elementor
star

Sat Jun 25 2022 11:52:14 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/39685167/list-all-the-tags-in-a-wordpress-blog

#wordpress #tags
star

Sat Jun 11 2022 12:05:36 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/52057378/repeater-inside-group-acf-wordpress

#wordpress
star

Thu Jun 02 2022 12:30:50 GMT+0000 (Coordinated Universal Time) https://wordpress.stackexchange.com/questions/348870/how-to-access-custom-order-item-meta-data-from-a-meta-key-in-woocommerce

#wordpress #woocommerce #order #item #meta #key
star

Tue May 31 2022 19:36:45 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/47611251/any-way-to-overwrite-get-stock-quantity-in-my-functions-php

#wordpress #php #stock #quantity #filter
star

Tue May 31 2022 14:49:26 GMT+0000 (Coordinated Universal Time) https://wordpress.stackexchange.com/questions/53194/wordpress-paginate-wpdb-get-results

#wordpress #wpdb #pagination #php
star

Tue May 31 2022 04:36:39 GMT+0000 (Coordinated Universal Time)

#woocommerce #wordpress
star

Thu May 26 2022 20:21:06 GMT+0000 (Coordinated Universal Time)

#wordpress #php
star

Thu May 26 2022 20:19:53 GMT+0000 (Coordinated Universal Time)

#wordpress #html
star

Thu May 26 2022 20:17:54 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Thu May 26 2022 20:13:46 GMT+0000 (Coordinated Universal Time) https://docs.memberpress.com/article/381-how-to-edit-lessons-in-classroom-mode-with-a-page-builder

#php #memberpress #wordpress
star

Fri May 20 2022 16:21:21 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Thu May 19 2022 08:04:13 GMT+0000 (Coordinated Universal Time)

#html #wordpress
star

Tue May 17 2022 14:02:47 GMT+0000 (Coordinated Universal Time) https://wpdevdesign.com/taxonomy-term-specific-image-grid-using-meta-box/

#php #metabox #wordpress
star

Thu Apr 28 2022 09:15:28 GMT+0000 (Coordinated Universal Time) https://squelchdesign.com/web-design-newbury/woocommerce-detecting-order-complete-on-order-completion/

#woocommerce #wordpress #orders #hook
star

Sat Apr 23 2022 20:08:48 GMT+0000 (Coordinated Universal Time) https://pluginrepublic.com/add-custom-cart-item-data-in-woocommerce/

#woocommerce #wordpress #filters
star

Fri Apr 22 2022 23:59:22 GMT+0000 (Coordinated Universal Time) https://dev.to/ninjasoards/easy-headless-wordpress-with-nuxt-netlify-5c4a

#php #wordpress
star

Tue Apr 19 2022 16:38:21 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Mon Apr 04 2022 06:59:28 GMT+0000 (Coordinated Universal Time)

#wordpress #oxygen #flickity
star

Tue Mar 22 2022 07:42:56 GMT+0000 (Coordinated Universal Time) https://www.wpbeginner.com/wp-tutorials/how-to-set-get-and-delete-wordpress-cookies-like-a-pro/

#php #wordpress
star

Fri Mar 18 2022 12:37:51 GMT+0000 (Coordinated Universal Time) https://wordpress.stackexchange.com/questions/131814/if-the-current-user-is-an-administrator-or-editor

#wordpress
star

Wed Mar 16 2022 10:57:46 GMT+0000 (Coordinated Universal Time)

#wordpress #woocommerce #woof
star

Wed Mar 16 2022 05:42:29 GMT+0000 (Coordinated Universal Time)

#wordpress #woocommerce #woof
star

Tue Mar 15 2022 14:15:16 GMT+0000 (Coordinated Universal Time)

#wordpress #php #woocommerce
star

Tue Mar 15 2022 14:03:42 GMT+0000 (Coordinated Universal Time)

#wordpress #php #woocommerce
star

Tue Mar 15 2022 12:48:38 GMT+0000 (Coordinated Universal Time)

#wordpress #php #woocommerce
star

Tue Mar 15 2022 12:44:34 GMT+0000 (Coordinated Universal Time)

#wordpress #php #woocommerce
star

Tue Mar 15 2022 10:08:58 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/40403364/how-to-enqueue-scripts-in-wordpress-from-cdn

#javascript #wordpress
star

Tue Mar 15 2022 10:08:38 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/40403364/how-to-enqueue-scripts-in-wordpress-from-cdn

#javascript #wordpress
star

Tue Mar 15 2022 00:31:04 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Tue Mar 15 2022 00:27:48 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Tue Feb 22 2022 19:30:31 GMT+0000 (Coordinated Universal Time)

#css #divi #wordpress
star

Thu Feb 17 2022 09:54:30 GMT+0000 (Coordinated Universal Time) https://www.webnots.com/4-ways-to-disable-smart-or-curly-quotes-in-wordpress/

#wordpress #plugin
star

Wed Feb 09 2022 07:22:18 GMT+0000 (Coordinated Universal Time) https://faq.o2switch.fr/gestion-site/debug-page-blanche-erreur-500

#php #wordpress #debug
star

Tue Jan 11 2022 21:41:16 GMT+0000 (Coordinated Universal Time)

#wordpress #css
star

Thu Dec 23 2021 14:51:05 GMT+0000 (Coordinated Universal Time)

#wordpress #loopw
star

Wed Dec 22 2021 23:16:29 GMT+0000 (Coordinated Universal Time) https://es.stackoverflow.com/questions/505679/para-los-que-conocen-wordpress-y-creadores-de-temas/505704#505704

#wordpress #html #php
star

Wed Dec 22 2021 21:29:14 GMT+0000 (Coordinated Universal Time) https://snipsave.com/user/richflynn/snippet/CKoeXWGzyW91z9xEma/

#elementor #wordpress
star

Fri Dec 17 2021 17:46:27 GMT+0000 (Coordinated Universal Time) https://make.wordpress.org/themes/2021/12/15/reminder-if-your-theme-integrates-with-external-plugins-make-sure-that-they-are-available-before-trying-to-use-them/

#php #wordpress
star

Thu Dec 09 2021 11:10:27 GMT+0000 (Coordinated Universal Time)

#mysql #wordpress
star

Wed Dec 01 2021 00:27:48 GMT+0000 (Coordinated Universal Time) https://formstyler.com/

#css #contact #cf7 #wordpress
star

Mon Nov 22 2021 19:22:51 GMT+0000 (Coordinated Universal Time) https://kinsta.com/nl/kennisbank/voeg-expires-headers-wordpress/

#wordpress #htaccess
star

Thu Nov 18 2021 03:18:48 GMT+0000 (Coordinated Universal Time)

#wordpress #php #gutenberg
star

Thu Nov 18 2021 03:18:21 GMT+0000 (Coordinated Universal Time)

#php #gutenberg #wordpress
star

Wed Nov 17 2021 17:57:20 GMT+0000 (Coordinated Universal Time) https://desarrollowp.com/blog/tutoriales/mover-los-scripts-al-footer-wordpress/

#javascript #css #wordpress
star

Mon Oct 25 2021 06:55:32 GMT+0000 (Coordinated Universal Time) https://github.com/srikat/my-custom-functionality/blob/master/plugin.php

#wordpress #mu-plugins #php
star

Mon Oct 25 2021 06:48:12 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/reference/functions/wp_enqueue_script/

#wordpress #mu-plugins #jquery
star

Mon Oct 25 2021 06:36:11 GMT+0000 (Coordinated Universal Time) https://www.sitepoint.com/wordpress-mu-plugins/

#wordpress #php #mu-plugins
star

Mon Oct 25 2021 05:31:55 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/applying-styles-with-stylesheets/

#wordpress #gutenberg #styles
star

Mon Oct 25 2021 05:16:11 GMT+0000 (Coordinated Universal Time) https://www.npmjs.com/package/@wordpress/create-block

#wordpress #gutenberg #git #npm
star

Mon Oct 25 2021 04:49:03 GMT+0000 (Coordinated Universal Time) https://www.wordstamped.com/1022/full-width-oxygen-block/

#wordpress #oxygen #css #gutenberg
star

Mon Oct 25 2021 04:21:40 GMT+0000 (Coordinated Universal Time)

#wordpress #php #wp-config
star

Mon Oct 25 2021 04:15:43 GMT+0000 (Coordinated Universal Time)

#wordpress #php #wp-config
star

Mon Oct 25 2021 03:40:24 GMT+0000 (Coordinated Universal Time) https://github.com/WebDevStudios/WDS-Required-Plugins

#wordpress #php #plugin
star

Fri Oct 22 2021 16:30:17 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/reference/functions/add_action/

#php #wordpress #functions #documentation #prority
star

Thu Jul 22 2021 21:24:54 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Thu Jul 22 2021 21:23:10 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Thu Jul 22 2021 21:21:50 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Thu Jul 22 2021 21:21:21 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Mon Jul 05 2021 16:02:04 GMT+0000 (Coordinated Universal Time)

#webhook #wordpress
star

Thu Jul 01 2021 10:52:22 GMT+0000 (Coordinated Universal Time) https://www.wpbeginner.com/wp-tutorials/how-to-disable-automatic-update-email-notification-in-wordpress/

#wordpress
star

Thu Jun 24 2021 12:26:19 GMT+0000 (Coordinated Universal Time)

#wordpress #functions.php #blockeditor
star

Fri Jun 11 2021 14:15:50 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/cli/commands/search-replace/, https://wordpress.org/support/article/changing-the-site-url/

#wordpress #configuration #url #network
star

Mon Jun 07 2021 18:06:54 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/7586995/read-variables-from-wp-config-php

#wordpress #database #credentials #automate
star

Wed May 26 2021 10:14:35 GMT+0000 (Coordinated Universal Time) https://www.johnparris.com/exclude-certain-pages-from-wordpress-search-results/

#php #wordpress
star

Thu May 13 2021 21:59:34 GMT+0000 (Coordinated Universal Time) https://www.clevelandwebdeveloper.com/code-snippets/wordpress-add-allowed-file-types/

#php #wordpress
star

Thu May 13 2021 15:05:08 GMT+0000 (Coordinated Universal Time) https://www.tychesoftwares.com/how-to-add-plus-and-minus-buttons-to-the-quantity-input-on-the-product-page-in-woocommerce/

#php #wordpress
star

Wed May 12 2021 22:38:25 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Wed May 12 2021 22:38:09 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Wed May 12 2021 22:37:45 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Wed May 12 2021 22:37:16 GMT+0000 (Coordinated Universal Time)

#php #wordpress #elementor
star

Wed May 12 2021 22:36:52 GMT+0000 (Coordinated Universal Time)

#php #wordpress #elementor
star

Wed May 12 2021 22:36:18 GMT+0000 (Coordinated Universal Time)

#php #wordpress #elementor
star

Fri May 07 2021 18:34:56 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Fri May 07 2021 18:34:23 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Fri May 07 2021 18:33:50 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Fri May 07 2021 18:26:52 GMT+0000 (Coordinated Universal Time)

#php #wordpress #woocomerce
star

Fri May 07 2021 18:26:02 GMT+0000 (Coordinated Universal Time)

#php #wordpress #woocomerce
star

Fri May 07 2021 18:25:16 GMT+0000 (Coordinated Universal Time)

#php #wordpress #woocomerce
star

Fri May 07 2021 18:24:18 GMT+0000 (Coordinated Universal Time)

#php #wordpress #woocomerce
star

Fri May 07 2021 18:21:47 GMT+0000 (Coordinated Universal Time)

#php #wordpress
star

Fri May 07 2021 18:15:24 GMT+0000 (Coordinated Universal Time) https://wpdev.co.il/%d7%94%d7%92%d7%93%d7%a8%d7%94-%d7%90%d7%95%d7%98%d7%95%d7%9e%d7%98%d7%99%d7%aa-%d7%a9%d7%9c-%d7%9b%d7%95%d7%aa%d7%a8%d7%aa-alt-%d7%9b%d7%99%d7%aa%d7%95%d7%91-%d7%95%d7%aa%d7%99%d7%90%d7%95%d7%a8/

#php #wordpress
star

Sat Mar 06 2021 03:42:11 GMT+0000 (Coordinated Universal Time) https://rckflr.com

#wordpress #google #tag #manager #function
star

Sat Feb 13 2021 14:25:20 GMT+0000 (Coordinated Universal Time)

#nginx #wordpress
star

Wed Jan 27 2021 14:37:32 GMT+0000 (Coordinated Universal Time)

#wordpress
star

Wed Jan 27 2021 14:28:21 GMT+0000 (Coordinated Universal Time)

#wordpress #ada #accessibility
star

Sun Jan 17 2021 16:45:51 GMT+0000 (Coordinated Universal Time)

#elementor #wordpress #jquery
star

Thu Oct 01 2020 20:31:22 GMT+0000 (Coordinated Universal Time) http://man.hubwiz.com/docset/WordPress.docset/Contents/Resources/Documents/codex.wordpress.org/Function_Reference/WP_Query.html

#wordpress #query #taxonomie
star

Thu Oct 01 2020 20:30:16 GMT+0000 (Coordinated Universal Time) http://man.hubwiz.com/docset/WordPress.docset/Contents/Resources/Documents/codex.wordpress.org/Function_Reference/WP_Query.html

#wordpress #query #taxonomie
star

Thu Oct 01 2020 20:29:15 GMT+0000 (Coordinated Universal Time) http://man.hubwiz.com/docset/WordPress.docset/Contents/Resources/Documents/codex.wordpress.org/Function_Reference/WP_Query.html

#wordpress #query #taxonomie
star

Wed Aug 26 2020 16:08:48 GMT+0000 (Coordinated Universal Time)

#php #wordpress

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension