Skip to content

Instantly share code, notes, and snippets.

View cristianstan's full-sized avatar
🎯
Focusing

Cristian Stan cristianstan

🎯
Focusing
View GitHub Profile
@cristianstan
cristianstan / Simple Ajax Login Form.php
Last active February 22, 2025 16:16
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
@cristianstan
cristianstan / Meeek SaaS: Replace Add to Cart text.php
Created March 26, 2024 08:33
Meeek SaaS: Replace Add to Cart text
<?php
function meeeksaas_add_to_cart_text_override($text){
return esc_html__('Buy Now', 'meeeksaas');
}
add_filter('meeeksaas_pricing_add_to_cart_text', 'meeeksaas_add_to_cart_text_override');
// Tutorial made for Meeek SaaS: https://codecanyon.net/item/meeek-bio-links-saas-wordpress/46935773
@cristianstan
cristianstan / Verified Owner text.php
Created March 21, 2024 12:19
Meeek SaaS: How to replace the 'Verified Owner text'?
<?php
function meeeksaas_verified_owner_text_override() {
// Your Own text here
$new_text = __('Verified User', 'meeek-saas');
return esc_html($new_text);
}
add_filter( 'meeeksaas_verified_owner_text', 'meeeksaas_verified_owner_text_override');
@cristianstan
cristianstan / gutenberg-demo-content.html
Last active October 3, 2023 09:32
Gutenberg Demo Data for Testing Purposes - WordPress v5.0
<!-- wp:cover {"url":"https://cldup.com/Fz-ASbo2s3.jpg","align":"wide"} -->
<div class="wp-block-cover has-background-dim alignwide" style="background-image:url(https://cldup.com/Fz-ASbo2s3.jpg)"><p class="wp-block-cover-text">Of Mountains &amp; Printing Presses</p></div>
<!-- /wp:cover -->
<!-- wp:paragraph -->
<p>The goal of this new editor is to make adding rich content to WordPress simple and enjoyable. This whole post is composed of <em>pieces of content</em>—somewhat similar to LEGO bricks—that you can move around and interact with. Move your cursor around and you’ll notice the different blocks light up with outlines and arrows. Press the arrows to reposition blocks quickly, without fearing about losing things in the process of copying and pasting.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>What you are reading now is a <strong>text block</strong> the most basic block of all. The text block has its own controls to be moved freely around the post...</p>
@cristianstan
cristianstan / Fatal error: Uncaught Error: Call to a member function dirlist() on null in extension_wbc_importer.php:77 Helper.php
Created August 10, 2023 13:28
Fatal error: Uncaught Error: Call to a member function dirlist() on null in extension_wbc_importer.php:77 Helper.php
<?php
function dirToArray($dir) {
$result = array();
$cdir = scandir($dir);
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..")))
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
@cristianstan
cristianstan / FontAwesome 5 all icons in list.txt
Last active June 15, 2023 04:33
FontAwesome 5 cheatsheet all icons in PHP array.php
fab fa-500px
fab fa-accessible-icon
fab fa-accusoft
fab fa-acquisitions-incorporated
fas fa-ad
fas fa-address-book
fas fa-address-card
fas fa-adjust
fab fa-adn
fab fa-adobe
@cristianstan
cristianstan / Get country code by country name *(English Names).php
Created April 11, 2023 14:05
Get country code by country name *(English Names).php
<?php
// Getting the country code (For example for "United States" the code is "US")
// Usage: get_country_flag_by_country_name('United States');
function get_country_flag_by_country_name($country_name = ''){
$all_countries = array(
'Afghanistan' => 'AF',
'Aland Islands' => 'AX',
'Albania' => 'AL',
'Algeria' => 'DZ',
@cristianstan
cristianstan / custom.js
Created March 11, 2022 13:28
Login/Register Modal in ModelTheme themes
/*LOGIN MODAL */
var ModalEffects = (function() {
function init_modal() {
var overlay = document.querySelector( '.modeltheme-overlay' );
var overlay_inner = document.querySelector( '.modeltheme-overlay-inner' );
var modal_holder = document.querySelector( '.modeltheme-modal-holder' );
var html = document.querySelector( 'html' );
[].slice.call( document.querySelectorAll( '.modeltheme-trigger' ) ).forEach( function( el, i ) {
@cristianstan
cristianstan / Redux theme options.php
Created March 11, 2022 13:25
Social Share buttons in ModelTheme themes
<?php
// Subtab in Social Media tab
# Section: Social Shares
$this->sections[] = array(
'subsection' => true,
'icon' => 'el-icon-share',
'title' => __('Social Shares', 'angro'),
'fields' => array(
@cristianstan
cristianstan / Dokan add product before popup form html.php
Created March 7, 2022 17:13
Dokan add product before popup form html.php
<?php
add_action('dokan_new_product_before_product_area','ibid_dokan_before_popup_form');
function ibid_dokan_before_popup_form(){
?>
<div class="my-class relative">Hello There</div>
<style type="text/css">
.my-class.relative {
position: absolute;
top: 20px;
padding-left: 20px;