This gist has been migrated to a repo here.
| <?php | |
| //set up pods::find parameters to limit to 5 items | |
| $param = array( | |
| 'limit' => 5, | |
| ); | |
| //create pods object | |
| $pods = pods('pod_name', $params ); | |
| //check that total values (given limit) returned is greater than zero | |
| if ( $pods->total() > 0 ) { |
| The only requirements for popup footnotes in iBooks are: | |
| * Ebook has to be an EPUB3 | |
| * epub:type "noteref" and "footnote" | |
| So you can link to a totally separate document, as you normally would for endnotes, | |
| but include the attributes so the <a> link behaves differently in iBooks, instead triggering the popup. | |
| Original reference link would look something like this (in a file called ch001.html): | |
| <a epub:type="noteref" href="footnote.html#note1">1</a></div> |
| <?php | |
| /* | |
| Plugin Name: Pods Starter Plugin | |
| Version: 0.0.1 | |
| License: GPL v2 or later | |
| */ | |
| //note: change 'slug' to your own custom prefix. | |
| add_action( 'plugins_loaded', 'slug_extend_safe_activate'); | |
| function slug_extend_safe_activate() { |
This is what we did to setup a few dashboards at platanus
- Raspberry Pi
- Dashing Service
- Wifi stick (optional)
This is a WORK IN PROGRESS intended for fleshing out and feedback
It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link> element to that CSS. If the plugin needs JavaScript, it will add a <script> to that JavaScript.
Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.
But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.
| function sv_wc_order_status_manager_order_is_editable( $editable, $order ) { | |
| // list the slugs of all order statuses that should be editable. | |
| // Note 'pending', 'on-hold', 'auto-draft' are editable by default | |
| $editable_custom_statuses = array( 'packaging', 'awaiting-shipment' ); | |
| if ( in_array( $order->get_status(), $editable_custom_statuses ) ) { | |
| $editable = true; | |
| } |
| INITIALISATION | |
| ============== | |
| load wp-config.php | |
| set up default constants | |
| load wp-content/advanced-cache.php if it exists | |
| load wp-content/db.php if it exists | |
| connect to mysql, select db | |
| load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
| load wp-content/sunrise.php if it exists (multisite only) |
| <?php | |
| /** | |
| * Disables repeat purchase for products / variations | |
| * | |
| * @param bool $purchasable true if product can be purchased | |
| * @param \WC_Product $product the WooCommerce product | |
| * @return bool $purchasable the updated is_purchasable check | |
| */ | |
| function sv_disable_repeat_purchase( $purchasable, $product ) { |
MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.
Including them in this way isn't always possible or easy with WordPress.
The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.
To use it, modify the baseUrl, uuid, and lid attributes with the ones from the original popup script that MailChimp supplies.