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 update_value( $post_id, $field, $value ){ | |
// Check to see if there are any old relationships | |
if( parent::get_value( $post_id, $field ) !== '' ){ | |
// If so, find out what needs to be added or deleted | |
$old_value = explode( ',', parent::get_value( $post_id, $field ) ); | |
$new_value = explode( ',', $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 | |
// Get the repeater field | |
$repeater = get_field( 'repeater_field_name' ); | |
// Get a random rows. Change the second parameter in array_rand() to how many rows you want. | |
$random_rows = array_rand( $repeater, 2 ); | |
// Loop through the random rows if more than one is returned | |
if( is_array( $random_rows ) ){ |
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 | |
/* Replace database connection information in wp-config.php */ | |
// Get the host | |
$host = $_SERVER['HTTP_HOST']; | |
if( $host === 'local.website.com' || $host === 'localhost:8888' ){ | |
// ** MySQL settings - You can get this info from your web host ** // |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
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
// Get the host | |
$host = $_SERVER['HTTP_HOST']; | |
// Define the site base | |
$site_base = 'example.com'; | |
// WP subdirectory | |
$wp_subdirectory = ''; | |
if( $host === 'local.' . $site_base || $host === 'localhost:8888' ){ |
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 | |
$types = explode( ",", $_GET['types'] ); | |
foreach( $workoutmoves AS $workoutmove ): | |
?> | |
<li> | |
<input class="check_box" type="checkbox" <?php in_array( $workoutmove->slug, $types ) ? 'checked' : ''; ?> value="<?php echo $workoutmove->slug; ?>"> <?php echo $workoutmove->name; ?> | |
</li> | |
<?php endforeach; ?> |
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
craft()->on('entries.saveEntry', function(Event $event) { | |
$entry = $event->params['entry']; | |
if( $event->params['entry']->sectionId == 4 ) { | |
craft()->request->redirect( '/admin/nameofplugin' ); | |
} |
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 Craft; | |
/** | |
* Craft by Pixel & Tonic | |
* | |
* @package Craft | |
* @author Pixel & Tonic, Inc. | |
* @copyright Copyright (c) 2014, Pixel & Tonic, Inc. | |
* @license http://buildwithcraft.com/license Craft License Agreement |
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
<!DOCTYPE html> | |
<head> | |
{# Base #} | |
{% includeCssFile 'layouts/base/css/base.css' %} | |
{% includeJsFile 'layouts/base/js/base.js' %} | |
{# Header #} | |
{% includeCssFile 'modules/header/css/header.css' %} | |
{% includeJsFile 'modules/header/js/header.js' %} |
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 | |
abstract class AbstractEntity extends AbstractValueObject | |
{ | |
/** | |
* Offset Set | |
* | |
* @param mixed $offset | |
* @param mixed $value | |
* |
OlderNewer