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 | |
// Find the description at https://bloggerpilot.com/en/gutenberg-for-woocommerce/ | |
// Disable new WooCommerce product template (from Version 7.7.0) | |
function bp_reset_product_template($post_type_args) { | |
if (array_key_exists('template', $post_type_args)) { | |
unset($post_type_args['template']); | |
} | |
return $post_type_args; | |
} |
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 | |
/** | |
* @Given /^I am logged in as a user in the "(?P<group>[^"]*)" group$/ | |
*/ | |
public function iAmLoggedInAsAUserInTheGroup($group) { | |
// Create user. | |
$account = (object) array( | |
'pass' => $this->getDrupal()->random->name(), | |
'name' => $this->getDrupal()->random->name(), | |
); |
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 | |
use Behat\Mink\Extension\ElementNotFoundException; | |
use Drupal\DrupalExtension\Context\DrupalContext; | |
class FeatureContext extends DrupalContext { | |
/** | |
* @When I select the first autocomplete option for :prefix on the :field field | |
*/ |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20180808 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
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 | |
/** | |
* Using BuddyPress Member types API | |
* | |
* see codex: https://codex.buddypress.org/developer/member-types/ | |
* | |
* Required config: | |
* - WordPress 4.1 | |
* - BuddyPress 2.2 | |
* |
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 | |
/** | |
* @Given /^I follow meta refresh$/ | |
*/ | |
public function iFollowMetaRefresh() { | |
while ($refresh = $this->getMainContext()->getSession()->getPage()->find('css', 'meta[http-equiv="Refresh"]')) { | |
$content = $refresh->getAttribute('content'); | |
$url = str_replace('0; URL=', '', $content); | |
$this->getMainContext()->getSession()->visit($url); | |
} |
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 | |
/** | |
* Migrate existing field content from language "undefined" to entity language. | |
*/ | |
function MODULE_update_N(&$sandbox) { | |
// Number of entities to be processed for each step. | |
$messages = array(); | |
if (!isset($sandbox['fields'])) { | |
// Initialize the array of field to process. |
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 | |
/** | |
* custom_tinymce | |
*/ | |
function vpm_custom_tinymce( $settings ) { | |
// Define our custom formats | |
$style_formats = array( | |
array( |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-min-and-max-character-limit.php | |
*/ | |
/** | |
* Gravity Wiz // Require Minimum Character Limit for Gravity Forms | |
* | |
* Adds support for requiring a minimum number of characters for text-based Gravity Form fields. |
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 | |
use Behat\Behat\Context\ClosuredContextInterface, | |
Behat\Behat\Context\TranslatedContextInterface, | |
Behat\Behat\Context\BehatContext, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; | |
/** |
NewerOlder