Skip to content

Instantly share code, notes, and snippets.

🇧🇷

Renato Alves renatonascalves

🇧🇷
Block or report user

Report or block renatonascalves

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
@renatonascalves
renatonascalves / wordpress-embed-sample-urls.json
Created Aug 12, 2019 — forked from kevinfodness/wordpress-embed-sample-urls.json
A data file containing sample URLs for WordPress oEmbed or Gutenberg Embed block testing (credit to oembed.com for some of these)
View wordpress-embed-sample-urls.json
[
{
"provider": "Amazon Kindle",
"url": "https://www.amazon.com/dp/B00E257T6C"
},
{
"provider": "Animoto",
"url": "https://animoto.com/play/WmGs0SgMeHvBMur0fL68rw"
},
{
@renatonascalves
renatonascalves / postmark-split-wp-mail.php
Created Aug 1, 2019 — forked from danielbachhuber/postmark-split-wp-mail.php
Splits wp_mail() with more than 40 bcc into multiple batches
View postmark-split-wp-mail.php
<?php
/**
* Splits a wp_mail() call with more than 40 bcc
* headers into multiple batches.
*
* Postmark only accepts 50 bcc, so this ensures the API call doesn't fail.
*
* @param array $args Original arguments passed to wp_mail().
* @return
*/
@renatonascalves
renatonascalves / bp-custom.php
Created Jul 12, 2019 — forked from imath/bp-custom.php
Registering REST Fields for the BP REST API
View bp-custom.php
<?php
// Registers a REST field for the Activity Endpoints.
function example_register_activity_rest_field() {
bp_rest_register_field(
'activity', // Id of the BuddyPress component the REST field is about
'example_field', // Used into the REST response/request
array(
'get_callback' => 'example_get_rest_field_callback', // The function to use to get the value of the REST Field
'update_callback' => 'example_update_rest_field_callback', // The function to use to update the value of the REST Field
@renatonascalves
renatonascalves / is_rest.php
Created Jun 10, 2019 — forked from matzeeable/is_rest.php
Checks if the current request is a WP REST API request.
View is_rest.php
<?php
if (!function_exists('is_rest')) {
/**
* Checks if the current request is a WP REST API request.
*
* Case #1: After WP_REST_Request initialisation
* Case #2: Support "plain" permalink settings
* Case #3: URL Path begins with wp-json/ (your REST prefix)
* Also supports WP installations in subfolders
*
@renatonascalves
renatonascalves / test.php
Created May 24, 2019 — forked from spacedmonkey/test.php
Add gutenberg blocks to WordPress API as json.
View test.php
<?php
add_action( 'rest_api_init', function () {
$types = get_post_types(
[
'show_in_rest' => true,
],
'names'
);
View wp_mail.md

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.9.

There are a few TODOs left. Please bear with me.

You can’t perform that action at this time.