Skip to content

Instantly share code, notes, and snippets.

View Oliviercreativ's full-sized avatar

Démontant Oliviercreativ

View GitHub Profile
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@jsnelders
jsnelders / wordpress_export_to_json.php
Last active April 17, 2024 05:24
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@mattclements
mattclements / function.php
Last active April 16, 2024 17:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@iqbalrony
iqbalrony / elementor-tips-tricks.php
Last active March 20, 2024 05:44
Elementor coding tips tricks. (Exclude & Include example for elementor group control)
<?php
/*
* Exclude & Include in group control
*/
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'item_background',
'label' => __( 'Background', 'happy-addons-pro' ),
'types' => [ 'classic', 'gradient' ],
@iqbalrony
iqbalrony / wp-custom-reset-password-form.php
Last active March 6, 2024 16:09
WordPress custom reset password form
<?php
/*
*Example Follw:-https://code.tutsplus.com/tutorials/build-a-custom-wordpress-user-flow-part-3-password-reset--cms-23811
*/
// Create the custom pages at plugin activation
register_activation_hook( __FILE__, 'dgm_plugin_activated' );
function dgm_plugin_activated() {
// Information needed for creating the plugin's pages
$page_definitions = array(
@karlhillx
karlhillx / macos_mojave_homebrew_apache_php_mariadb_2019.md
Last active February 21, 2024 09:51
macOS Mojave Setup: Homebrew + Apache + PHP + MariaDB (Regularly updated)

macOS Mojave Setup: Homebrew + Apache + PHP + MariaDB

This document provides help on getting your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, etc.

Homebrew Logo

Homebrew Installation

Homebrew is an excellent package manager for macOS; let's install it.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
@alexmustin
alexmustin / form-content.html
Created February 4, 2018 21:31
WordPress AJAX Live Search of Post Title
<!-- // The HTML (could be part of page content) // -->
<input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input>
<div id="datafetch">Search results will appear here</div>
@aderaaij
aderaaij / acf-future-posts.php
Last active February 8, 2024 14:29
Advanced Custom Fields datepicker: Show only events with a date of today or in the future. Extra comments from Pasnon @ ACF Forums: f you needed to, you could also play with the comparison date, which is the first array in meta_query, currently set to date("Y-m-d") which is today; if you were to make it date("Y-m-d", strtotime("-1 day")) you cou…
<?php
/*
* Display posts only from today and in the future:
* http://old.support.advancedcustomfields.com/discussion/6000/how-to-sort-posts-by-acf-date-and-display-only-future-posts
* by Pasnon
*/
$date_args = array(
'post_type' => 'events',
@azizultex
azizultex / WordPress Shortcode with ob_start()
Created March 3, 2016 03:16
WordPress Shortcode with ob_start()
function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));
@workeffortwaste
workeffortwaste / woocommerce-to-css-grid.css
Last active January 22, 2024 15:52
woocommerce-to-css-grid
/* Convert the standard WooCommerce products list into a modern responsive grid. */
ul.products {
--grid-gap: 32px;
--auto-grid-min-size: 200px;
grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
grid-gap: var(--grid-gap);
display: grid;
}
ul.products:before{
content:unset!important;