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 | |
/** | |
* Create a Nova select field and assign a default value in a Nova Flexible Content layout. | |
* Flexible Content: https://github.com/whitecube/nova-flexible-content | |
* Nova select field: https://nova.laravel.com/docs/resources/fields.html#select-field | |
*/ | |
namespace App\Nova\Flexible\Layouts; |
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
/* | |
* This snippet allows the form to be reloaded by including the following link in the confirmation message: | |
* | |
* <a href="" id="reload-form">Submit this form again?</a> | |
* | |
* You can customize the text of link, but leave the "id" attribute as is. | |
* | |
*/ | |
add_filter('gform_pre_render_115', 'save_form_html'); |
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
#!/bin/bash | |
#Create new folders for projects and add an Nginx server block to run the new static and php sites. | |
#TODO: Make find and replace for domain when copying the boilerplate config using $baseurl | |
#Set server folders; defaults based on basic installation on Ubuntu / Debian | |
baseurl='example.com' | |
htdocs='/var/www/html/' | |
defaultsbfile='/etc/nginx/sites-available/new-server-block' |
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
# Block WordPress xmlrpc.php requests | |
<Files xmlrpc.php> | |
order deny,allow | |
deny from all | |
</Files> |
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 | |
//Grab pages, print subnav if page has children. | |
$id = get_the_ID(); | |
$ancestors = get_post_ancestors($id); | |
// Get top parent of this page or current page | |
$topParent = $id; | |
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 | |
//Grabbing locations depending on the page | |
if ( is_page( 'facilities' ) ) { | |
$metaValue = 'facility'; | |
} elseif ( is_page( 'dropoff' ) ) { | |
$metaValue = "dropoff"; | |
} else { | |
$metaValue = "event"; | |
} |
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
<form action="<?php bloginfo('url'); ?>" method="get"> | |
<?php | |
//Generate dropdown list | |
$select = wp_dropdown_pages(array( | |
'echo' => 0, | |
'sort_column' => 'post_title', | |
)); | |
echo str_replace('<select', '<select onchange="this.form.submit()" class="whatever"', $select); | |
?> | |
</form> |