Skip to content

Instantly share code, notes, and snippets.

Marcio Duarte pagelab

Block or report user

Report or block pagelab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
pagelab / functions.php
Created Aug 12, 2019 — forked from tessak22/functions.php
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
View functions.php
* Register hero block
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
pagelab / wp-mailhog.php
Created Aug 5, 2019 — forked from bishless/wp-mailhog.php
Configure WordPress on Valet to use MailHog
View wp-mailhog.php
* @link
* @since 1.0.0
* @package TODO
* @wordpress-plugin
* Plugin Name: Use MailHog
* Description: Configure WordPress on Valet to use MailHog
* Version: 1.0.0
View edd-webhook-handler.php
Plugin Name: EDD Webhooks
Description: Captures new sale notifications from 3rd party service and adds to Easy Digital Downloads
Version: 1.0
Author: Brian Hogg
Author URI:
Text Domain: edd-webhooks
License: GPL2
pagelab / git-pushing-multiple.rst
Created Jul 21, 2019 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.
View git-pushing-multiple.rst

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

pagelab / functions.php
Created Jul 18, 2019 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page.
View functions.php
* Automatically login a single WordPress user upon arrival to a specific page.
* Redirect to home page once logged in and prevent viewing of the login page.
* Compatible with WordPress 3.9.1+
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1.
pagelab / copy-pre.css
Created Jul 15, 2019 — forked from stephenharris/copy-pre.css
Adding a 'copy' button to <pre> content
View copy-pre.css
.pre-wrapper pre{
padding-top: 25px;
.pre-wrapper .copy-snippet {
border-radius: 0;
background: none repeat scroll 0 0 transparent;
pagelab / mobtable.html
Created Jun 11, 2019 — forked from hkirsman/mobtable.html
turn tables into mobile friendly
View mobtable.html
<html xmlns="" xml:lang="et">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.odd { background-color: #808080; }
.generated_for_mobile { margin-bottom: 30px }
pagelab / wpquery.php
Created May 23, 2019
Referência completa do WP_Query
View wpquery.php
* WordPress Query Comprehensive Reference
* Compiled by luetkemj -
* Source:
$args = array(
//////Author Parameters - Show posts associated with certain author.
pagelab / trim-excerpt-whitespace.php
Created Apr 24, 2019 — forked from mindpalette/trim-excerpt-whitespace.php
WordPress Filter - Trim Excerpt Whitespace
View trim-excerpt-whitespace.php
// trim excerpt whitespace
if ( !function_exists( 'mp_trim_excerpt_whitespace' ) ) {
function mp_trim_excerpt_whitespace( $excerpt ) {
return trim( $excerpt );
add_filter( 'get_the_excerpt', 'mp_trim_excerpt_whitespace', 1 );
pagelab /
Created Jan 24, 2019 — forked from bananana/
Bash script to run automatic updates and backups using wp-cli
# Backup and update WordPress using wp-cli
# Set the -e shell option so the script exits immediately if any command within
# it exits with a non-zero status.
set -e
# Set PATH environment variable
You can’t perform that action at this time.