jlanpheer
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Help with use of wp_redirect in custom pluginRyan, thank you for your thoughtful response. I believe that you hit on it in your last comment about potentially nesting hooks inside of my logic, i believe that is/was the culprit. I did some re-analysis of how to solve my problem and decided rather than forcibly directing the user, that i would instead (after a successful login) to instead present one or more links to them to choose from based on the assigned role and allow them to choose their option themselves. So, i was able to step around this problem.
But, i do appreciate your response. Can you clarify for me where the proper place to put redirect code is in instances where you are doing this in a plugin? If your plugin is a class, is the ‘proper’ place to put your action and function code in the constructor itself?
Thanks much for taking the time to help me understand this, i’m learning ‘the WordPress Way’ as i go here…..
Forum: Developing with WordPress
In reply to: Help with use of wp_redirect in custom pluginNo, it doesn’t. I initially thought that ‘wp_loaded’ would do the trick, but that didn’t work, leading me to try ‘template_redirect’ and finally ‘init’. All resulted in the same error. Is the proper place to do this in the constructor of my object/class? My best guess is that perhaps my code was in the wrong place.
I’m editing just to be clear, i thought that this statement would go in my class’ constructor:
add_action('template_redirect', array($this, 'redirect_to_funnel'));The function would be properly placed in the class body. As in:
class MyClass { function __construct() { add_action('template_redirect', array($this, 'redirect_to_funnel')); ....... } // end constructor function redirect_to_funnel() { $slug = get_post_field( 'post_name', get_post() ); if ($slug == 'login-page' && $_SESSION['login_attempted']) { wp_safe_redirect(home_url('my-options-choice-page')); exit(); } } // end function } end classI’ve also tried putting all of this code (obviously not as a class) in the functions.php file, so removing the class references, the add_action that i tried looked like this:
add_action('template_redirect', 'redirect_to_funnel');- This reply was modified 2 years, 4 months ago by jlanpheer. Reason: editing for clarification and to reduce back-and-forth questions
Forum: Plugins
In reply to: [Elementor Website Builder - more than just a page builder] Text editorThank you for the explanation, and i do understand it. It does say ‘Paragraph’ under the option. What baffles me is two things: (1) why is there not simply a ‘plain text’ option? There’s 6 different kinds of headings and a “paragraph” option. Why not a ‘plain text’ option? (2) Whoever created this section to begin with set these up as ‘Text Editor’ widgets and when they set them up, they were clearly able to do so without the paragraph formatting. How did they do that?
So, i DO very much appreciate your explanation of why the paragraph formatting is added. However, i am trying to (a) fix these and (b) instruct our client how to proceed if they wish to add to this list in the future. There are some EIGHTY names on this list and i’m an hoping there’s a way to format these without the paragraph heading that does NOT involve having to rewrite EIGHTY Text Editor widgets as custom HTML widgets.
Since this was clearly originally done without custom HTML widgets, i am hoping that someone can provide a way for me to (a) fix the ones that are broken and (b) advise my client how to proceed in the future.
Thank you!
Forum: Plugins
In reply to: [Elementor Website Builder - more than just a page builder] Text editorForum: Plugins
In reply to: [WooCommerce] Ability to change quantity not visible on product pagePlease disregard, i just discovered the bit of code that a prior developer had put into the functions.php file. If anyone comes along with a similar problem, one thing to check is whether this filter has been set up:
add_filter( 'woocommerce_is_sold_individually', 'wc_remove_all_quantity_fields', 10, 2 ); function wc_remove_all_quantity_fields( $return, $product ) { return( true ); }I have no idea why the original developer set up this filter, but i hope this helps someone in the future.
Also, if this behavior were happening in a single browser type or something, i could say perhaps a setting on my local browser. But, the problem persists across all my test machines and browsers.
The ‘user agent stylesheet’ sets the display property to ‘none !important’ and the ‘!important’ does not allow me to override it, but again, i don’t have a clue where that value is being set.
- This reply was modified 2 years, 8 months ago by jlanpheer.
Hi Herman, understood. We definitely do has some custom css code written. What i don’t understand is how to get to the culprit. The input is showing in the dev tools console as ‘Hidden’. However, rather than pointing to a line in the style.css file, the dev tools indicate that the source of the styling of “input[type=”hidden” i]” is “user agent stylesheet” with no line number given. I’m baffled on how to trace that to the source. I can’t find any styling CSS code that we’ve written at all that would lead me to believe it’s something we’ve coded. Any tips on how to get more meaningful info than “user agent stylesheet”? Thank you if you can, i’d like to learn something new here. π
Hi Herman, thank you for your reply. If i switch to the parent Astra theme, the quantity does display. An order page is here: https://tevcon.com/register-now/
If you click on one of the passes or add one to the cart and go to the cart, the ability to change quantity is not offered.
Forum: Themes and Templates
In reply to: [Astra] Cannot access Gutenberg editor in Astra themeThank you for your reply Herman, much appreciated. I wasn’t aware of the change in terminology. However, i’m pretty sure that i’m looking at the ‘classic’ editor. https://drive.google.com/file/d/1nmGzI6WHadzpBGKkevQ9NenhX1Xkzbee/view?usp=sharing
This is my default editor when i create a page:
https://drive.google.com/file/d/1-rutYb1t2gtu_66ZOaJ9JKn7D6npDFOX/view?usp=sharing
Forum: Themes and Templates
In reply to: [Astra] Cannot access Gutenberg editor in Astra themep.s. I would embed an image of what i see in Starter Templates in the top right corner, but i can’t seem to attach an image to this post via a URL that would take you to the file on my Google drive.
But, if you go into Starter Templates and go to the top right corner, you get a list of template types, and ‘Gutenberg’ is NOT one of my options. “Block Editor” is. My theory is that somehow/somewhere there’s a setting that i don’t know about. I’ve only seen this with the Astra theme though in any of the modern sites that i’ve worked on recently.
OK, thanks for your reply. I had a deadline and ended up building my own solution, but i will circle back and test it.
I thought that i’d add that the site (in development) is using a simple Astra child theme, no bells/whistles, VERY vanilla site so far….
I’ve done as you’ve asked above, i’ve downloaded/installed the latest 2.30 version and have set my site’s wp-config setting WP_DEBUG to true. I re-installed the plugin, attempted to add a view and got the same result. I found NO debug log in the wp-content folder. I then went back and added these two lines to my wp-config file:
define( ‘WP_DEBUG_DISPLAY’, false ); define( ‘WP_DEBUG_LOG’, true );
This did not change anything. Still no debug information at all. Do you have other suggestions?
Thank you for your reply, i had what i thought was the latest version, so my apologies for that. I’ll update, try again and advise. Thank you!
Not sure why my image is not displaying in this post, the image is on the google drive. I’ll attach a link here: https://drive.google.com/file/d/16AYbEbQ_kTL8Ym8wSjMpIN5y7rptDSVt/view?usp=sharing