Skip to content

Instantly share code, notes, and snippets.

View version-control's full-sized avatar

version-control version-control

View GitHub Profile
<?php
/**
* Gravity Perks // Limit Submissions + Nested Forms // Scope Limit Feeds to Current Parent Entry
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/
*/
add_action( 'gpls_before_query', function( $ruletest ) {
global $wpdb;
// Update "123" to your child form ID.
if( $ruletest->form_id == 123 && class_exists( 'GPNF_Session' ) && $parent_form_id = rgpost( 'gpnf_parent_form_id' ) ) {
<?php
/**
* Gravity Perks // Multi-page Navigation + Easy Passthrough // Make Pages Navigable When Editing Entry
* http://gravitywiz.com/documentation/gravity-forms-multi-page-navigation/
* http://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
*
* When repopulating an entry into a form for editing via Easy Passthrough and
* [this snippet](https://gravitywiz.com/edit-gravity-forms-entries-on-the-front-end/), make all pages navigable if
* Multi-page Navigation is enabled for the given form and configured to allow navigating to any completed page.
*/
Get a powershell session as administrator
Set-ExecutionPolicy RemoteSigned
You need to configure this setting only once on your computer, not every time you connect.
-----------------------
Connect to powershell
How to install the Laravel Installer:
I assume you have php and composer in your PATH already.
First of all install the Laravel Installer. Open a command prompt and enter:
composer global require "laravel/installer=~1.1"
Then update the PATH environment variable via e.g. command prompt with admin privileges:
setx /M path "%path%;%appdata%\Composer\vendor\bin"
%appdata% is added, so you don’t have to worry about adding your computer name.
How to create a fresh Laravel Installation:
The Ports Collection is a set of Makefile, patches, and description files stored in /usr/ports. This set of files is used for building and installing applications on FreeBSD, and other BSD-based operating systems.
This post will describe how to use portmaster, a utility for updating installed ports. portmaster is nothing more than a shell script (albeit a quite elegant and powerful one), written in /bin/sh. It does not depend upon other ports, external databases or languages, rather it’s been written in such a way as to make use of the information about a port’s dependencies, dependents, file locations and other information contained in /var/db/pkg to determine which ports to update.
The versions of software discussed in this post are as follows:
FreeBSD 11.0-RELEASE
portmaster-3.17.10
Okay, let’s get started. All commands are issued as the root user or by simulating the root user by using the command su. Let’s make sure that the Ports Collection is updated to its most current version with the following co
<nav id="site-navigation" class="main-navigation">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'feel-the-energy' ); ?></button>
<?php
wp_nav_menu( array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
) );
?>
</nav><!-- #site-navigation -->
@version-control
version-control / nginx.conf
Created December 26, 2017 08:37 — forked from spikegrobstein/nginx.conf
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
ACL Plugin does not have retrospective renaming of fields within the system. Pretty pointless in my eyes but if you do install ACL and then decide to rename the fields then use the database.
Below is from the owner on the forum.
------------------------------------------
The best way is to edit the field and change the field name. Next, access your DB via phpMyAdmin and write some SQL to look for the old field_name and replace it with the new field_name.
The field name will bi found multiple times in the wp_postmeta table in the meta_name column.
@version-control
version-control / gist:a0788ae8b3a7b7a7b00f68753100c58f
Last active December 17, 2017 16:13
WP Index Display Number of Comments
<!-- Display Number of Comment -->
<?php
$args = array(
'post_id' => $post->ID, // use post_id, not post_ID
'count' => true //return only the count
);
$comments = get_comments($args);
echo '<h4>REVIEW COUNT = '.$comments.'</h4>'
?>
@version-control
version-control / gist:3f7fab5279ff5caf43b3c56c3606048d
Created December 17, 2017 16:09
WP Index Include Comments in Loop
<?php
echo '<h6><p>';
//Gather comments for a specific page/post
$comments = get_comments(array(
'post_id' => $post->ID,
'status' => 'approve'
));
wp_list_comments(array(