Skip to content

Instantly share code, notes, and snippets.

Svetoslav Marinov lordspace

Block or report user

Report or block lordspace

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lordspace
lordspace / qs_blog675_grant_customizer_access.php
Last active Dec 7, 2019
How to Allow Non-Admin Users to Access WordPress Customizer. Check the latest version on the qSandbox - https://qsandbox.com/675
View qs_blog675_grant_customizer_access.php
<?php
/**
* How to Allow Non-Admin Users to Access WordPress Customizer. Published on the qSandbox - https://qsandbox.com/675
* <a href="https://qsandbox.com/?utm_source=qs_blog_code&utm_medium=p675" title="Free Test/Staging WordPress site by qSandbox.com">Free Test/Staging WordPress site by qSandbox.com</a>
* @param array $all_caps
* @param array $cap
* @param array $args
* @return array array
* @see https://codex.wordpress.org/Plugin_API/Filter_Reference/user_has_cap
@lordspace
lordspace / openssl.cnf
Created May 7, 2019
This file is from Apache installation and it's referenced by this tutorial : How to Generate Certificate Authority (CA) Key and SSL Certificate with OpenSSL at https://orbisius.com/4583
View openssl.cnf
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@lordspace
lordspace / wc-css-make-storefront-product-tabs-horizontal
Created May 23, 2018 — forked from vanbo/wc-css-make-storefront-product-tabs-horizontal
WooCommerce: CSS to make Storefront product tabs horizontal again
View wc-css-make-storefront-product-tabs-horizontal
/*
vanbo/wc-css-make-storefront-product-tabs-horizontal
credit: https://gist.github.com/vanbo/c05e9b9512bd53e3680c82e1c6e4e6a3
*/
.product .woocommerce-tabs ul.tabs {
width: 100%;
float: none;
margin-right: 5.8823529412%;
}
@lordspace
lordspace / orbisius_quick_fix_wc_ext_opt_co_fields.php
Created Aug 7, 2017
This code allows you to make some WooCommerce Checkout Fields optional.
View orbisius_quick_fix_wc_ext_opt_co_fields.php
<?php
/*
This code allows you to make some WooCommerce Checkout Fields optional.
Blog post http://orbisius.com/link/3710
Author: Svetoslav Marinov (Slavi)
Author URI: http://orbisius.com
*/
/*
Installation
@lordspace
lordspace / set_up_ssl_for_wp_news_site.txt
Last active Dec 19, 2016
These are instructions related to this article (How to Properly Set up an SSL Certificate for a News Site Based on WordPress) http://orbisius.com/wordpress/properly-set-ssl-certificate-news-site-based-wordpress/
View set_up_ssl_for_wp_news_site.txt
How To Setup Let's Encrypt SSL certificate for a news Site and Fix Mixed Content Error
///////////////////////////////////
// put this in wp-config.php
// orbisius.com
// GPL
ob_start( 'orbisius_custom_link_corrector_global' );
/**
* This is used here to correct all links that are not ssl
@lordspace
lordspace / mandrill_email_test.php
Last active Nov 6, 2015
This is an sample php code that uses mandrill service to send emails. It uses PHPMailer. Here is an article how to do the setup: https://medium.com/@qsandbox/getting-started-with-mandrill-c2c3a6ba5c2a
View mandrill_email_test.php
<?php
// Author: Slavi Marinov | Orbisius.com & qSandbox.com
// 0) Read this article https://medium.com/@qsandbox/getting-started-with-mandrill-c2c3a6ba5c2a
// 1) Join Mandrill at http://mandrill.com/
// 2) Download PHPMailer from https://github.com/PHPMailer/PHPMailer
// Adapted example from: shared/PHPMailer-master/examples/mailing_list.phps
require_once 'shared/PHPMailer-master/class.phpmailer.php';
require_once 'shared/PHPMailer-master/class.smtp.php';
$message = "This is a test message prepared on: " . date( 'r' ) . " from " . $_SERVER['HTTP_HOST'] . ' ' . $_SERVER['REMOTE_ADDR'];
@lordspace
lordspace / load-assets.php
Created Oct 28, 2015
How to load WordPress assets and append last modified time so the browser loads them only when necessary.
View load-assets.php
// the vhost has this line to define the environment 'SetEnv DEV_ENV development'
$suffix = empty($_SERVER['DEV_ENV']) ? '.min' : '';
wp_register_style('my-awesome-plugin', plugins_url("/assets/main{$suffix}.css", __FILE__), false,
filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.css" ) );
wp_enqueue_style('my-awesome-plugin');
wp_enqueue_script( 'jquery' );
wp_register_script( 'my-awesome-plugin', plugins_url("/assets/main{$suffix}.js", __FILE__), array('jquery', ),
filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.js" ), true);
View orbisius-fb-open-graph-tags.php
<?php
/*
Plugin Name: Orbisius Facebook Share Image Preview Fix
Plugin URI: http://orbisius.com
Description: Makes sure that post's featured image is 1200x630 so facebook can use it as preview.
Version: 1.0.0
Author: Svetoslav Marinov (Slavi)
Author URI: http://club.orbisius.com/products/
*/
@lordspace
lordspace / zzz_sync.php
Created Dec 15, 2014
How to Sync Your Plugins with a Staging Server Using WP-CLI
View zzz_sync.php
<?php
/**
* This script allows you to sync plugins from development machine with staging/live servers.
* Author: Svetoslav Marinov (SLAVI) | http://orbisius.com
* (c) All Rights Reserved.
* (c) Dec 2014
* License: LGPL
* zzz_sync.php
*/
@lordspace
lordspace / Fake Sendmail Configuration Mandrill
Created Aug 26, 2014
Fake Sendmail Configuration for Using it with Mandrill. Uses non-ssl version as the SSL one worked OK on CLI but hanged when accessed via Apache
View Fake Sendmail Configuration Mandrill
; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail
[sendmail]
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
You can’t perform that action at this time.