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
<x-layout> | |
<x-slot name="head"> | |
<x-social-media-meta | |
title="Blade Component Examples" | |
description="Learn about all sorts of Blade component tips and tricks." | |
image="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg" | |
card="summary" | |
/> | |
</x-slot> |
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
#!/usr/bin/env bash | |
# for debug output, uncomment: | |
#set -x | |
function help { | |
echo "WordPress cleanup -v 0.5 2018-06-26 / [email protected] | |
Usage: |
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 video_get_service( $video_url ) { | |
if ( stristr( $video_url, 'vimeo.com') ) { | |
return 'vimeo'; | |
} | |
if ( stristr( $video_url, 'youtube.com' ) || stristr( $video_url, 'youtu.be' ) ) { | |
return 'youtube'; | |
} |
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 | |
namespace JensSogaard; | |
class BlockHelper | |
{ | |
/** | |
* Gets ACF fields for a specific block on a given post | |
* @author Jens Soegaard <[email protected]> | |
*/ | |
public function getBlockFromPage(string $block_id, int $post_id) |
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 | |
namespace App\View\Components; | |
use Roots\Acorn\View\Component; | |
class Rating extends Component | |
{ | |
/** | |
* The rating value. |
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: Programmatically add Gravity Forms | |
Plugin URI: https://daan.kortenba.ch/programmatically-add-gravity-forms/ | |
Description: Programmatically add persistent Gravity Forms forms. | |
Author: Daan Kortenbach | |
Version: 0.1 | |
Author URI: https://daan.kortenba.ch/ | |
License: GPLv2 or later | |
*/ |
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
/** .pause-gif */ | |
.wrap-pause-gif { | |
position: relative; | |
text-align: center; | |
} | |
.pause-gif { | |
visibility: hidden; | |
} |
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 | |
/* | |
First, create API Projects at https://www.vimexx.nl/api | |
Second, replace all vars between [] with credentials from previous step! | |
Third, see below; | |
$vimexx = (new \Vimexx([account], 'wefact')); | |
var_export($vimexx->post('/domains')); | |
var_dump($vimexx->client('whmcs')->post('/domain/dns', ['sld' => 'achterstraat', 'tld' => 'com'])); | |
var_export($vimexx->client('wefact')->post('/domains')); | |
*/ |
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
/** | |
* Add this to your setup.php | |
* Usage @loop( $wp_query ) or $loop and end with @endloop | |
* the new $loop variable is available | |
* | |
* Create @loop Blade directive | |
*/ | |
\Roots\app('blade.compiler')->directive('loop', function ($query = null) { | |
global $wp_query; | |
if (!$query) $query = $wp_query; |
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
if( !is_admin() && class_exists('\DOMDocument' ) ){ | |
/** | |
* Checks if a gravity form has been submitted | |
* @return bool | |
*/ | |
function form_submitted(){ | |
return isset( $_POST['gform_submit'] ) && '1' === $_POST['gform_submit']; | |
} | |