Skip to content

Instantly share code, notes, and snippets.

Avatar

Najeeb Ahmad nmedia82

View GitHub Profile
@nmedia82
nmedia82 / guide.txt
Last active Feb 24, 2021
N-Media Plugins Settings
View guide.txt
# Auth
N-Media Plugin Authentication Handling Script
* Checkout this repo inside plugin root or copy the Auth directory into plugin
* Remove .git directory, otherwise it will not be added into main plugin
* Paste following script into plugin main file after INCLUDING the files etc
<pre>
// Authencation checking
@nmedia82
nmedia82 / ppom-price-v2-extending.js
Created Dec 19, 2019
PPOM Price V2 - Extending price object example
View ppom-price-v2-extending.js
// PPOM Price V2 Related
class PPOM_OQ_Class extends PPOM_Price_Class{
constructor(field, value){
super(field, value)
}
get_price() {
let p = this.field.price || '';
@nmedia82
nmedia82 / gist:1a7fa42dc6e8235c7eb2591414b234ff
Last active Oct 14, 2019
Hiding Yith inquiry tab for certain categories
View gist:1a7fa42dc6e8235c7eb2591414b234ff
/**
** Hiding for tab for following categories
** Signage
** print
** Signage + print
** Crystal awards
**/
// Paste collowing code inside your theme's functions.php file
View gist:a0ec36cc08cc581719b2c5458ebd77c2
create host file in /etc/apache2/sites-available
make sure AWS Route 53 as Host/Zone Entry for this
For WordPress Permissions Issue
> sudo chown www-data:www-data /var/www/ -R
View twoco.js
"use strict"
var successCallback = function(data) {
var checkout_form = jQuery( 'form.woocommerce-checkout' );
// add a token to our hidden input field
console.log(data);
var token = data.response.token.token;
checkout_form.find('#twoco_token').val(token);
@nmedia82
nmedia82 / functions.php
Created Apr 25, 2018
Change admin admin to get WooConvo notification
View functions.php
// Add this code at theme's function.php at bottom
add_filter('wooconvo_message_receivers', 'wooconvo_change_admin_email', 10, 2)
function wooconvo_message_receivers($receivers, $is_admin) {
if( $is_admin ) {
$receivers = array('your@email.com'); // add more email if need in array
}
return $receivers;
}
@nmedia82
nmedia82 / nmInputs.php
Last active Sep 21, 2017
NM Input Class
View nmInputs.php
<?php
/**
* Inputs rendering class
**/
// constants/configs
define( 'ECHOABLE', false );
class NM_Form {
@nmedia82
nmedia82 / nm-wp-helper-functions.php
Created Mar 16, 2017
N-Media Helper Functions File
View nm-wp-helper-functions.php
/**
* WPML
* registering and translating strings input by users
*/
if( ! function_exists('nm_wpml_register') ) {
function nm_wpml_register($field_value, $domain) {
$field_name = $domain . ' - ' . sanitize_key($field_value);
@nmedia82
nmedia82 / files-in-um-profile-tabs
Last active Oct 9, 2016
Adding Profile Tab in Ultimate Member Plugin to show Member Uploaded Files on Frontend
View files-in-um-profile-tabs
// this will add tab heading
add_filter('um_profile_tabs', 'user_files', 1000 );
function user_files($tabs) {
$tabs['userfiles'] = array(
'name' => 'My Files', // you can change this
'icon' => 'um-faicon-file', // you can change this
);
return $tabs;
@nmedia82
nmedia82 / wp-dynamic-css.php
Created Oct 6, 2016
How add dynamic css in WP plugin while rendering shortcode
View wp-dynamic-css.php
function render_shortcode_template($atts){
extract(shortcode_atts(array(), $atts));
if($this -> get_option("_show_icons") == 'yes'){
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
}
wp_enqueue_style($this->plugin_meta['shortname'].'-styles', $this->plugin_meta['url'].'templates/post-frontend-style.css');
//getting dynamic css