Skip to content

Instantly share code, notes, and snippets.

View daniloroddrigues's full-sized avatar

Danilo Rodrigues daniloroddrigues

  • Full Stack Developer
View GitHub Profile
@daniloroddrigues
daniloroddrigues / htaccess_umbler
Created March 28, 2024 03:42
Umbler Htaccess
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@daniloroddrigues
daniloroddrigues / wp_rename_table.sql
Last active March 8, 2024 23:40
How to change the prefix of the database tables on WordPress
RENAME table wp_actionscheduler_actions TO new_actionscheduler_actions;
RENAME table wp_actionscheduler_claims TO new_actionscheduler_claims;
RENAME table wp_actionscheduler_groups TO new_actionscheduler_groups;
RENAME table wp_actionscheduler_logs TO new_actionscheduler_logs;
RENAME table wp_commentmeta TO new_commentmeta;
RENAME table wp_comments TO new_comments;
RENAME table wp_links TO new_links;
RENAME table wp_options TO new_options;
RENAME table wp_postmeta TO new_postmeta;
RENAME table wp_posts TO new_posts;
@daniloroddrigues
daniloroddrigues / codes.json
Last active December 22, 2023 00:21
List Countries php, ISO 3166 country code and List Country txt
{
"ad": "Andorra",
"ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
"al": "Albania",
"am": "Armenia",
"ao": "Angola",
"aq": "Antarctica",
@daniloroddrigues
daniloroddrigues / functions.php
Created December 4, 2023 19:01 — forked from vishalbasnet23/functions.php
User Registration Front End WordPress with Ajax
<?php
add_action('wp_ajax_register_user_front_end', 'register_user_front_end', 0);
add_action('wp_ajax_nopriv_register_user_front_end', 'register_user_front_end');
function register_user_front_end() {
$new_user_name = stripcslashes($_POST['new_user_name']);
$new_user_email = stripcslashes($_POST['new_user_email']);
$new_user_password = $_POST['new_user_password'];
$user_nice_name = strtolower($_POST['new_user_email']);
$user_data = array(
'user_login' => $new_user_name,
@daniloroddrigues
daniloroddrigues / setting.json
Created August 2, 2022 15:02
VScode Settings
{
"terminal.integrated.fontSize": 14,
"workbench.startupEditor": "newUntitledFile",
"polacode.backgroundColor": "#6633CC",
"editor.tabSize": 2,
"editor.fontSize": 16,
"editor.lineHeight": 26,
"editor.fontFamily": "Fira Code",
@daniloroddrigues
daniloroddrigues / password_wp.txt
Created July 12, 2022 22:57
Password for local host change database
admin
$P$BqkUCOYZwSyDH864WAQqHQ7.Ld743d0
@daniloroddrigues
daniloroddrigues / add_script_ajax.php
Created April 4, 2022 01:35
Filter Wordpress Php Ajax
function nb_filter_search()
{
wp_enqueue_script("js_nb_filter_search", get_stylesheet_directory_uri() . '/js/nbfilter.js', array('jquery'), '1.0', true);
wp_localize_script("js_nb_filter_search", 'ajax_nb_filter_search', array('ajax_url' => admin_url('admin-ajax.php')));
}
add_action('wp_enqueue_scripts', 'nb_filter_search');
@daniloroddrigues
daniloroddrigues / form.php
Created March 24, 2022 19:02 — forked from kharakhordindemo/form.php
Remove span in Contact Form 7
/*Contact form 7 remove span*/
add_filter('wpcf7_form_elements', function($content) {
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content);
$content = str_replace('<br />', '', $content);
return $content;
});
@daniloroddrigues
daniloroddrigues / wrapper_image.php
Last active April 22, 2024 18:19 — forked from cabans/Add Pinterest Button to all Images in the_content()
Wordpress - Function to wrap all images and adds Pinterest button
// Wordpress - Function to wrap all images and adds Pinterest button
// Add Pinterest Button to all Images in the_content()
// Wraps image with container and add link to share src from all <img> in the content
function gear_pinterest_in_content_images($content) {
$dom = new DOMDocument('UTF-8');
@$dom->loadHTML( utf8_decode($content) ); // Decode to simple ISO to avoid accent errors
$dom->preserveWhiteSpace = false;
$images = $dom->getElementsByTagName('img');
@daniloroddrigues
daniloroddrigues / form-step-jquery.html
Last active February 21, 2022 21:33
Form step jQuery
<form action=""
method="post">
<div id="wizard">
<!-- form-field -->
<h4></h4>
<section class="form-field">
<div>
<label for="name">Como devo te chamar? <span class="text-red-600">*</span></label>