This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fetch posts in chunks. | |
* | |
* This function fetches posts in chunks of a specified size, which can be useful for large datasets. | |
* | |
* @param string $post_type The type of post to fetch. Default is 'post'. | |
* @param int $posts_per_page The number of posts to fetch per page. Default is 100. | |
* @param array $custom_args Custom arguments to pass to WP_Query. Default is an empty array. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set from https://www.npmjs.com/package/@wordpress/scripts | |
// Add package.json with the @wordpress/scripts dependency. | |
// Add a root file called webpack.config.js | |
// Import the original config from the @wordpress/scripts package. | |
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); | |
// Import the helper to find and generate the entry points in the src directory | |
const { getWebpackEntryPoints } = require( '@wordpress/scripts/utils/config' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Load a template part & pass in variables declared in caller scope. Optionally return as a string. | |
* @param string $path path to template file, minus .php (eg. `content-page`, `partial/folder/template-name`) | |
* @param array $args map of variables to load into scope | |
* @param bool $echo echo or return rendered template | |
* @return null or rendered template string | |
*/ | |
function rb_get_template_part($path, $args = [], $echo = true) { | |
if (!empty($args)) { |