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 | |
add_filter( 'register_post_type_args', function( $args, $post_type ) { | |
if ( 'sfwd-courses' === $post_type ) { | |
$args['show_in_graphql'] = true; | |
$args['graphql_single_name'] = 'course'; | |
$args['graphql_plural_name'] = 'courses'; | |
} |
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 | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class WebhookController | |
{ | |
public function create(Request $request) | |
{ |
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 | |
/** | |
* Plugin Name: Remove WooCommerce DB Notice | |
* Plugin URI: https://woocommerce.com | |
* Description: Clears out any pending WooCommerce DB Update notices | |
* Author: WooCommerce | |
* Domain Path: /languages | |
* Version: 0.1 | |
*/ |
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
<div class="wrap"> | |
<div class="wrap-inner"> | |
<div class="swiper-outter"> | |
<div id="video-swiper" class="swiper-container"> | |
<div class="swiper-wrapper"> | |
<div class="swiper-slide"> | |
<div class="video-container"> | |
<div class="yt-player" data-id="MxBRpWcXeOA"></div> |
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
import { Fragment } from "@wordpress/element"; | |
import { InnerBlocks } from "@wordpress/editor"; | |
/** | |
* Changes the edit function of an ACF-block to allow InnerBlocks | |
* Should be called like this on `editor.BlockEdit` hook: | |
* ` addFilter("editor.BlockEdit", "namespace/block", editWithInnerBlocks("acf/block-name"));` | |
* | |
* @param {string} blockName the name of the block to wrap | |
* @param {object} innerBlockParams params to be passed to the InnerBlocks component (like allowedChildren) |
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
/** | |
* WordPress Blocks | |
* | |
* Default block styling included with WordPress core. | |
* Provides a better starting point for WordPress theme developers, | |
* especially when using Sass. | |
* | |
* @link https://github.com/WordPress/WordPress/blob/master/wp-includes/css/dist/block-library/style.css | |
* | |
* Most styles from the above file are included. |
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
# Export site database using wp db export | |
wp db export /wp-content/wordpress-dump.sql --all-tablespaces --single-transaction --quick --lock-tables=false | |
# Gzip compress the recent database export | |
gzip wordpress-dump.sql | |
# Export sites database using wp db export and gzip compress | |
wp db export --all-tablespaces --single-transaction --quick --lock-tables=false - | gzip -9 - > wordpress-dump.sql.gz |
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 | |
// Add facets | |
add_filter('facetwp_facets', function () { | |
// Video category checkboxes | |
$facets[] = array( | |
'label' => 'Video Category', | |
'name' => 'video_category', | |
'type' => 'radio', | |
"source" => "tax/category", | |
"parent_term" => "", |
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 | |
/** | |
** enable filtering on load of map | |
**/ | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
var filterButton = $( ".facetwp-map-filtering" ); |
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 | |
// number of users we want to show per page | |
$number = 10; | |
// to pinpoint the current pagination number | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
// count the number of users that should be passed over in the pages (offset) – this will take effect at the second page onwards. | |
$offset = ($paged - 1) * $number; |
NewerOlder