Angelo Rocha
Forum Replies Created
-
Forum: Plugins
In reply to: [Redux Framework] Redux 4.2.14 assets problem, 404 messageThanks
Forum: Plugins
In reply to: [Redux Framework] Redux 4.2.14 assets problem, 404 messageThanks for the answers and sorry for the delay.
I use Redux as a lib to manage my theme options, I currently use it inside my theme and a directory called “lib”, I don’t want to use Redux as a plugin or keep it out of my theme folder, in previous versions to Redux 4 this works fine. Is there any solution to not change the redux core?Forum: Plugins
In reply to: [Redux Framework] the problem not Resolved yestActive wordpress debug mode, may be conflict with another plugin.
Forum: Plugins
In reply to: [Redux Framework] Redux 4.2.14 assets problem, 404 messageHow to fix it? I’m using redux including in my composer autoload, my code:
composer.json:
"autoload": { "files": [ "inc/lib/ReduxCore/framework.php", ] },
My option file:
https://gist.github.com/angelorocha/5cba306b6ff14c89dd3ce008dee23084Thanks
- This reply was modified 3 years, 3 months ago by Angelo Rocha.
Forum: Developing with WordPress
In reply to: WP CLI Formatter, blank line after each resultCurrently the results are displayed very close together, making it difficult for the user to read.
Forum: Developing with WordPress
In reply to: WP CLI Formatter, blank line after each resultFor better table indentation.
Done!
global $wpdb; $queries = []; $total = 0; foreach($wpdb->queries as $key => $query): $queries[] = [ 'query' => $query[0], 'start' => number_format_i18n($query[1], 4), 'end' => $query[3], 'rows' => count($wpdb->get_results($query[0], ARRAY_A)), 'component' => $query['trace']->get_component()->name, ]; $total += $query[1]; endforeach; var_dump($queries);
Output:
array (size=5) 'query' => string 'SELECT option_value FROM wp_options WHERE option_name = 'active_sitewide_plugins' LIMIT 1' (length=89) 'start' => string '0,0001' (length=6) 'end' => float 1624391505.7874 'rows' => int 0 'component' => string 'Plugin: buddypress' (length=18)
Thanks again!
Forum: Developing with WordPress
In reply to: Identify plugin queries with wpdbWoa, very good, lol.
Thanks man! I will investigate the recipe <3Forum: Developing with WordPress
In reply to: Identify plugin queries with wpdb@joyously
ThanksForum: Developing with WordPress
In reply to: Identify plugin queries with wpdb@bcworkz
I’m investigating Query Monitor but I can’t determine how it does this, apparently it’s something very big and complex, so I thought there might be something simpler for this.Forum: Fixing WordPress
In reply to: Error install WordPress 5.7.1 in DockerThanks Alan!
Forum: Developing with WordPress
In reply to: Set theme mod after switch themeYes.
This is a solution to child themes, when a theme have more one child, this problem appears.Forum: Developing with WordPress
In reply to: Set theme mod after switch themeMy solution, i don’t know if this is a best way.
In case anyone need./** * Keep logo after switch theme */ add_action( 'init', 'rock_theme_keep_logo' ); function rock_theme_keep_logo() { /** * Check if custom logo exists */ if ( has_custom_logo() ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); /** * Store custom logo id in a option */ if ( ! get_option( 'rock_custom_logo_temp' ) ) { add_option( 'rock_custom_logo_temp', $custom_logo_id, '', 'no' ); } } } /** * After theme switch, keep logo */ add_action( 'after_switch_theme', 'rock_keep_logo_after_switch_theme' ); function rock_keep_logo_after_switch_theme() { if ( ! has_custom_logo() ) { if ( get_option( 'rock_custom_logo_temp' ) ) { set_theme_mod( 'custom_logo', get_option( 'rock_custom_logo_temp' ) ); } } }
Forum: Developing with WordPress
In reply to: Set theme mod after switch themeThis code is not a theme, I am trying to solve a problem that happens with any theme, it is a specific situation.