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 | |
| add_filter( 'posts_clauses', 'filter_clauses', 10, 2 ); | |
| /** | |
| * Filtering everything. | |
| * | |
| * @param array $clauses Array with all parts of the query. | |
| * @param WP_Query $wp_query Object. | |
| * @return string |
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 | |
| function change_yoast_seo_og_meta() { | |
| add_filter( 'wpseo_opengraph_desc', 'change_desc' ); | |
| } | |
| function change_desc( $desc ) { | |
| // This article is actually a landing page for an eBook | |
| if( is_singular( 123 ) ) { |
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
| var block = wp.blocks.createBlock('core/paragraph', {content: 'From Console'}); | |
| wp.data.dispatch('core/block-editor').insertBlocks(block); |
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: Recent Widget Challenge from ibenic.com/newsletter | |
| */ | |
| /* | |
| You will create a custom WordPress widget that displays a list of the most recent posts. | |
| Each recent post should have: |
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
| function nativeHorizontalScroll( id ) { | |
| var elID = id; | |
| var element = document.getElementById( id ); | |
| var scrolling = false; | |
| var initialX = 0; | |
| function getParent( node, id ) { | |
| if ( node.id === id ) { | |
| return node; | |
| } |
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
| jQuery( function( $ ) { | |
| var cities = wc_city_dropdown.cities; | |
| wrapper_selectors = '.woocommerce-billing-fields,' + | |
| '.woocommerce-shipping-fields,' + | |
| '.woocommerce-address-fields'; | |
| $( document.body ).on( 'change refresh', 'select.country_to_state, input.country_to_state', function() { | |
| var $wrapper = $( this ).closest( wrapper_selectors ); |
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
| // https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/autocompleters/block.js | |
| // ... | |
| return { | |
| name: 'blocks', | |
| className: 'editor-autocompleters__block', | |
| triggerPrefix: '/', | |
| options() { | |
| const selectedBlockName = getSelectedBlockName(); | |
| return getInserterItems( getBlockInsertionParentClientId() ).filter( | |
| // Avoid offering to replace the current block with a block of the same type. |
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 | |
| $args = array( | |
| 'label' => '', // Text in Label | |
| 'class' => '', | |
| 'style' => '', | |
| 'wrapper_class' => '', | |
| 'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
| 'id' => '', // required | |
| 'name' => '', //name will set from id if empty |
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 | |
| do_action( "{$taxonomy}_add_form_fields", string $taxonomy ); |
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 | |
| class WordPress_Custom_Status { | |
| /** | |
| * Post Types for this status | |
| * @var array | |
| */ | |
| protected $post_type = array(); |
NewerOlder