This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global YoastSEO */ | |
class YoastAnalysis { | |
constructor() { | |
// Initialize cached content storage for extra content to analyze | |
this.cachedContent = ''; | |
// Track whether the data fetching process has completed | |
this.isDataFetched = false; | |
// Check that YoastSEO and its analysis worker are available before proceeding | |
if ( typeof YoastSEO === "undefined" || typeof YoastSEO.analysis === "undefined" || typeof YoastSEO.analysis.worker === "undefined" ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enqueue the custom Yoast Analysis JavaScript in the WordPress admin editor. | |
add_action( 'admin_enqueue_scripts', function( $hook ) { | |
// Only load the script on post editing screens ('post.php' for edit, 'post-new.php' for new posts). | |
if ( in_array( $hook, [ 'post.php', 'post-new.php' ], true ) ) { | |
// Build the full URL to the JavaScript file in the theme's 'js' directory. | |
$script_path = get_template_directory_uri() . '/js/yoast-analysis.js'; | |
// Enqueue the script with a handle 'yoast-analysis'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// No direct access | |
defined( 'ABSPATH' ) || exit; | |
/** | |
* Set default values for ACF Textarea field in WP Admin | |
*/ | |
add_filter( 'acf/validate_field', function( $field ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare( strict_types=1 ); | |
/** Prevents direct file access for security. */ | |
defined( 'ABSPATH' ) || exit; | |
/** | |
* Class CodeSoup_CrossDomain_Cookie_Auth | |
* | |
* Drop-in class for secure cross-domain cookie authentication in WordPress REST API. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Lightning Address | |
* Plugin URI: https://gist.github.com/Bobz-zg/5e8fe19442d88ddb32bae428dfc199f3/edit | |
* Author: Vlado Bosnjak | |
* Author URI: https://github.com/code-soup | |
* Description: Handle the basics with this plugin. | |
* Version: 0.0.1 | |
* Requires at least: 5.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace {email} shortcode with actual email address | |
* | |
* @link https://github.com/woocommerce/woocommerce/blob/5a707f3e74a18af2d7bf14c20ee65e702a119557/includes/class-wc-countries.php#L601 | |
*/ | |
add_filter('woocommerce_formatted_address_replacements', function( $address, $args ) { | |
// Replace email for billing address | |
if ( isset( $args['billing_email'] ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Append email in list of visible info | |
* | |
* @link https://github.com/woocommerce/woocommerce/blob/ab4a46e32e338cbf33094ab26144744a021a21a9/includes/wc-account-functions.php#L316 | |
*/ | |
add_filter( 'woocommerce_my_account_my_address_formatted_address', function( $address, $user_id, $address_type ) { | |
// Meta key is either billing or shipping | |
$meta_key = $address_type . '_email'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Append email to address format | |
* | |
* @link https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-countries.php#L510 | |
*/ | |
add_filter( 'woocommerce_localisation_address_formats', function( $formats ) { | |
// Double quotes in sprintf() or \n will not be parsed as a new line character |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.forms-report-service { | |
&.loading { | |
opacity: 0.6; | |
pointer-events: none; | |
} | |
/** | |
* Grid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.forms-report-service { | |
&.loading { | |
opacity: 0.6; | |
pointer-events: none; | |
} | |
/** | |
* Grid |
NewerOlder