GET /wp-json/hpt/v1/articles
Public endpoint — no authentication required. Returns both post and triage post types, sorted by date descending.
A practical guide for reducing database queries on WordPress sites where page caching is bypassed (logged-in users, personalized content, membership sites). This guide covers three strategies: ACF (Advanced Custom Fields) options batch caching, fragment caching, and WP_Query optimization.
| import os | |
| import shutil | |
| import getpass | |
| import time | |
| # Set debug variable | |
| debug = False | |
| # Searches for a folder containing 'containers.index' within the given root_folder. | |
| def find_save_folder(root_folder): |
| <?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. | |
| * |
| Alachua | |
| Baker | |
| Bay | |
| Bradford | |
| Brevard | |
| Broward | |
| Calhoun | |
| Charlotte | |
| Citrus | |
| Clay |
| <?php | |
| add_filter( 'acfe/modules/single_meta/post_types', 'tprt_control_single_meta_post_types' ); | |
| function tprt_control_single_meta_post_types( $post_types ) { | |
| /** | |
| * Exclude specific post types from saving as single meta | |
| * | |
| * If you are not using ACFE to register your post types you | |
| * can skip steps 03 - 05a (comment or delete) and go |
| /* eslint-disable */ | |
| /** | |
| * Disables the refresh logic that ACF front-end forms uses in favor | |
| * of a custom AJAX submission. | |
| * | |
| * This was tested with ACF 5.12.3 | |
| * | |
| * This logic makes a few assumptions: | |
| * 1. ACF is queued and your script is properly defining it as a dependency. |
| <?php | |
| class Client extends Setup | |
| { | |
| public function __construct() | |
| { | |
| add_filter('process_markdown', array($this, 'process_markdown')); | |
| add_filter('tablepress_cell_content', array($this, 'process_markdown')); | |
| } | |
| public function process_markdown($text) |
| <?php | |
| /** | |
| * Compile a LESS file in Wordpress with lessphp while preserving the comment meta. | |
| * @param string $less_fname LESS input file path | |
| * @param string $css_fname CSS output file path | |
| */ | |
| function auto_compile_less($less_fname, $css_fname) | |
| { | |
| // WP 3.4 Setup | |
| $theme_meta = array(); |
| <FilesMatch "\.(?i:pdf)$"> | |
| ForceType application/octet-stream | |
| Header set Content-Disposition attachment | |
| </FilesMatch> |