This is the public
folder for Project Name. It can be used for your local development and is also used to push code to the staging and live environments via WP Engine's Git Push.
It currently contains the source code for:
<?php | |
function my_body_classes( $classes ){ | |
if ( is_page( 'about' ) ) { | |
$classes[] = 'page-about'; | |
} | |
return $classes; | |
} |
import { useSelect } from '@wordpress/data'; | |
/** | |
* AttachmentImage | |
* | |
* This component is used to display an image from the media library. | |
* It's meant as a JS companion to the PHP function `wp_get_attachment_image()`. | |
* | |
* @link https://www.briancoords.com/getting-wordpress-media-library-images-in-javascript/ |
<?php | |
/** | |
* All of the parameters passed to the function where this file is being required are accessible in this scope: | |
* | |
* @param array $attributes The array of attributes for this block. | |
* @param string $content Rendered block output. ie. <InnerBlocks.Content />. | |
* @param WP_Block $block The instance of the WP_Block class that represents the block being rendered. | |
* | |
* @package gutenberg-examples | |
*/ |
wp.domReady( () => { | |
let blocks = wp.blocks.getBlockTypes().map( ( block ) => block.name ); | |
blocks.forEach( ( block ) => { | |
if ( block.indexOf( 'core/' ) === 0 ) { | |
wp.blocks.unregisterBlockType( block ); | |
} | |
}); | |
} ); |
This is the public
folder for Project Name. It can be used for your local development and is also used to push code to the staging and live environments via WP Engine's Git Push.
It currently contains the source code for:
# Wordpress - ignore core, configuration, examples, uploads and logs. | |
# Forked from: https://github.com/github/gitignore/blob/main/WordPress.gitignore | |
# Core | |
/wp-admin/ | |
/wp-content/index.php | |
/wp-content/languages | |
/wp-content/plugins/index.php | |
/wp-content/themes/index.php | |
/wp-content/uploads/ |
<?php | |
/** | |
* Our custom alternative to wc_mail. | |
* | |
* @param mixed $to Receiver. | |
* @param mixed $subject Subject. | |
* @param mixed $message Message. | |
* @param string $headers Headers. (default: "Content-Type: text/html\r\n"). | |
* @param string $attachments Attachments. (default: ""). | |
* @return bool |
<?php | |
// Put this in wp-config.php and replace https://example.com/ with the URL of the production site. | |
define( 'BC_USE_REMOTE_MEDIA_URL', 'https://example.com' ); | |
// Put the rest of this in functions.php or a custom plugin or somewhere else. | |
if ( defined( 'BC_USE_REMOTE_MEDIA_URL' ) && ! empty( BC_USE_REMOTE_MEDIA_URL ) ) { | |
add_filter( 'wp_get_attachment_image_src', 'bc_filter_wp_get_attachment_image_src' ); | |
add_filter( 'wp_calculate_image_srcset', 'bc_filter_wp_calculate_image_srcset' ); | |
add_filter( 'wp_get_attachment_url', 'bc_filter_wp_get_attachment_url' ); | |
} |
(function($) { | |
$(document).ready(function($){ | |
}); | |
})( jQuery ); |
{ | |
"JQuery Frame": { | |
"prefix": "wpjquery", | |
"body": [ | |
"(function($) {", | |
"", | |
"\t$(document).ready(function($){", | |
"", | |
"\t\t$1", | |
"", |