Skip to content

Instantly share code, notes, and snippets.

View 2Fwebd's full-sized avatar

2Fwebd

  • Alkaweb
View GitHub Profile
<?php
/**
* Add the Vue.js library, the Google MAP API and our own component
*
* We are using a CDN for the library
*/
public function addScripts()
{
// Vue.js library
wp_enqueue_script(
// Add our JS files
add_action('wp_enqueue_scripts', array($this, 'addScripts'));
<?php
/**
* Load the BuddyPress members coordinates
*
* This is an Ajax callback, we just output the locations as a formatted JSON array
*
* @return void
*/
public function loadMembers() {
$is_request_safe = (
// Fetch the members positions
add_action('wp_ajax_wpffice_map_members', array($this, 'loadMembers'));
add_action('wp_ajax_nopriv_woffice_map_members', array($this, 'loadMembers'));
<?php
/**
* The private Google API key used for the GeoCoding API
*
* @var string
*/
private $privateApiKey = 'aaaaaaa';
/**
* Woffice_Members_Map constructor.
@2Fwebd
2Fwebd / Woffice_Members_Map.php
Created February 2, 2019 19:13
Creating the BuddyPress profile field
<?php
/**
* Class Woffice_Members_Map
*
* This class handles the Members Map backend actions and callbacks.
*
* As well as the render part
*
*/
<div id="buddypress">
<?php do_action( 'bp_before_activation_page' ); ?>
<div class="page" id="activate-page">
<?php do_action( 'template_notices' ); ?>
<?php do_action( 'bp_before_activate_content' ); ?>
function revert_to_old_design() {
return "woffice-2-x";
}
add_filter('woffice_design_version', 'revert_to_old_design')
<?php
/**
* Traitement
*/
session_start();
if(isset($_GET['articles_list']) && !empty($_GET['articles_list'])) {
// Du formulaire
@2Fwebd
2Fwebd / .php
Created January 23, 2017 16:03
<?php
/**
* Get Sales total from a REMOTE .json file
*
* @link https://shopicruit.myshopify.com/admin/orders.json?page=1&access_token=c32313df0d0ef512ca64d5b336a0d7c6
* @author François Forest
* @version 1.0.0
*/
Class ShopifyIntern
{