View paginationsequence.php
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 | |
/** | |
* Generate a sequence of numbers for use in a pagination system, the clever way. | |
* @author Bramus Van Damme <bramus@bram.us> | |
* | |
* The algorithm always returns the same amount of items in the sequence, | |
* indepdendent of the position of the current page. | |
* | |
* Example rows generated: |
View sf.php
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 | |
function themename_custom_logo_setup( $args ) { | |
$args['height'] = 116; | |
$args['width'] = 250; | |
return $args; | |
} | |
add_filter( 'storefront_custom_logo_args', 'themename_custom_logo_setup' ); |
View index.php
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_filters( 'wp_list_pages_excludes', function( $exclude_array ) { | |
$exclude_array = array( '121' ); | |
return $exclude_array; | |
} | |
); |
View example.php
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 | |
/** | |
* Filter the content of the new user registration email | |
* @param $message The email content | |
* @param $user The user object | |
* @param $blogname The name of the site | |
* @param $url The url for the user profile | |
*/ | |
function prefix_new_registration_email_content( $message, $user, $blogname, $url ) { | |
$_message = $meessage . '<br>'; |
View wordpress_export_to_json.php
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: WordPress Export to JSON | |
* Plugin URI: https://jsnelders.com/ | |
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file. | |
* Author: Jason Snelders | |
* Author URI: http://jsnelders.com | |
* Version: 2020-01-30.1 | |
**/ |
View shortcode.php
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 | |
function callout_shortcode( $atts ) { | |
$out = ''; | |
$atts = shortcode_atts( | |
array( | |
'callout_h4' => 'This is a header', | |
'callout_p' => 'This is the paragraph below it', | |
), | |
$atts |
View content.php
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 content of post format standard | |
* | |
* @author tokoo | |
* @version 2.0 | |
* @file wp-content/themes/pustaka-child/template-parts/content.php | |
*/ |
View RatchetServer.php
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\Services; | |
use Ratchet\Http\HttpServer; | |
use Ratchet\MessageComponentInterface; | |
use Ratchet\ConnectionInterface; | |
use Ratchet\Server\IoServer; | |
use Ratchet\WebSocket\WsServer; | |
class RatchetServer implements MessageComponentInterface |
View gist:949a95a7960d7202fe9bad4e3d93b77c
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
jQuery(document).ready(function() { | |
jQuery("#the-empty-div").click(function(){ | |
jQuery.ajax({ | |
type: 'POST', | |
url: my_ajax_data.ajax_url, | |
data: { | |
action: 'my_ajax_action_callback', | |
security: my_ajax_data.security_nonce, | |
first_name: 'John', // Get this however | |
last_name: 'Smith', // Get this however |
View gist:55fedea70ef392cb6baf359f3719b628
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 | |
function generate_json_ld() { | |
if ( ! is_single() ) { | |
return null; | |
} | |
$data = []; |
NewerOlder