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 | |
// File: mr-wc-integrator-plugin/btob/dashboard-b2b-widget.php | |
// | |
// Replace line #15 in the `view()` function containing raw HTML. | |
// <h1>Account Summary</h1> | |
// with the following PHP hook. | |
echo wp_kses_post( apply_filters( 'mr_b2b_widget_title', '<h1>Account Summary</h1>' ) ); |
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
// Select a block. | |
wp.data.dispatch("core/block-editor").selectBlock(clientId); | |
// Update block attributes. | |
wp.data.dispatch("core/block-editor").updateBlockAttributes(clientId, { content: "<p>this is the new content</p>"}); | |
// Replace a block. | |
wp.data.dispatch("core/block-editor").replaceBlock( | |
clientId, | |
wp.blocks.createBlock("core/image", { |
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 | |
// @see https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/#alm_query_args | |
function my_filter_args( $args, $id ){ | |
// [ajax_load_more id="my_alm_id"] | |
// Custom meta query clause. | |
$datum_clause = [ | |
'key' => 'datum', | |
'value' => date("Ymd"), | |
'compare' => '>=' , |
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
addEventListener('DOMContentLoaded', () => { | |
const taxonomies = window.media_taxonomies || {}; // Pluck the taxonomies from the localized script. | |
const AttachmentsBrowser = wp.media.view.AttachmentsBrowser; | |
const AttachmentFilters = wp.media.view.AttachmentFilters; | |
const mediaFilterClasses = {}; // Filter class storage. | |
if (!taxonomies?.length || !AttachmentsBrowser || !AttachmentFilters) { | |
// Bail if filters or classes don't exist. | |
return; | |
} |
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 | |
/** | |
* Parse the Default Values set inside the plugin. | |
* | |
* @since 1.13.0 | |
* @package ALMFilters | |
*/ | |
// Only run if Filters are present. | |
if ( $alm_filters_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
<!-- wp:paragraph --> | |
<p>Integer posuere erat a ante venenatis dadpibus posuere velit aliquet. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus auctor fringilla. Sed posuere consectetur est at lobortis. Etiam porta sem malesuada magna mollis euismod.</p> | |
<!-- /wp:paragraph --> | |
<!-- wp:acf/cta {"name":"acf/cta","data":{"theme":"blue-light","_theme":"field_6385060c403eb","image":109,"_image":"field_6398c610f4064","alignment":"right","_alignment":"field_6385063c403ec","block_theme":"blue","_block_theme":"field_63a2018e311b9"},"mode":"preview"} --> | |
<!-- wp:paragraph --> | |
<p></p> | |
<!-- /wp:paragraph --> | |
<!-- wp:heading --> |
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 | |
$categories = get_the_category(); | |
if ( ! empty( $categories ) ) { | |
$current_cat = esc_html( $categories[0]->name ); | |
} | |
echo do_shortcode('[ajax_load_more single_post="true" single_post_id="'. get_the_ID() .'" single_post_target=".type-post" post_type="post" single_post_order="query" category="' . $current_cat . '" pause_override="true"]'); ?> | |
OR |
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 | |
/** | |
* The template for displaying posts within the loop. | |
* | |
* @package GeneratePress | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} |
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 | |
// id: team_filter, key: category | |
add_filter('alm_filters_team_filter_category', function(){ | |
// Define empty array | |
$values = []; | |
// Get all categories | |
$args = array( | |
'order' => 'ASC', |
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
/* Setup autocomplete.js sources */ | |
var sources = []; | |
var suggestion_template = wp.template( config[ 'tmpl_suggestion' ] ); | |
var sources = [{ | |
source: algolia.autocomplete.sources.hits( client.initIndex( config[ 'index_name' ] ), { | |
hitsPerPage: config[ 'max_suggestions' ], | |
attributesToSnippet: [ | |
'content:10' | |
], | |
highlightPreTag: '__ais-highlight__', |
NewerOlder