Where to put coding a validation script for store? I am pretty new using WordPress and was asked to validate the number of items in the cart for an eCommerce site that lets you "make a pack" in which you have several steps, step 1 is a page in which you select the box, this doesn't need validation but the next 4 steps do, each step is a new page and each has a different amount of the item that you need to select, what I need is to either disable the hyperlink that says "Next step" until you select the correct amount of items for each step or just display a message when you click with the incorrect amount  Now my question is not code itself but where to put it in WordPress, I checked everything in the WordPress admin part of the site and on the hosting site but can't find where I am supposed to code the validation for each page.
Where to put my code: plugin or functions.php? Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php?  There    and many  about that topic, mostly because there are some misconceptions about the inner workings of WordPress. I am asking for an answer based on facts, not on opinions.  It should explain how to handle these points (and probably more):   custom post types and taxonomies contact forms shortcodes custom widgets  SEO functions like custom meta elements theme switch   There are often pros and cons for both sides. Our most popular question  got a lot of code snippets as answers that are at least debatable. We need criteria a beginner can understand, maybe a check list – with reasons.  See also the related question by Chip Bennett on our meta site:   Related:
I'm arriving to the US by air, but departing via land. How do I end form I-94 now that it is only electronic? Though I never quite understood what those numbers were and they were quite ugly, they were the only reason I ever visited the reviews page.   Can we have similar functionality back on the top bar please? Did Obi-Wan Kenobi ever become more powerful? In Star wars: IV A New Hope, Obi-Wan says to Darth Vader:     You can't win, Darth. If you strike me down, I shall become more powerful than you could possibly imagine.    What did he mean by this? Was he bluffing? Was he alluding to him being able to help Luke as a Force Ghost? Or was he talking on behalf of The Force? I was doing some re-tagging and I noticed that the automatically generated revision comment says that I edited the post body where I only edited the tags. Could an argument with false Premises and a true Conclusion be logically valid? Get name of caller function in PHP? Is there a PHP function to find out the name of the caller function in a given function? How do I retrieve an HTML element's actual width and height? Suppose that I have a &lt;div&gt; that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the &lt;div&gt; element.   What should I use? Please include information on browser compatibility. I'm an android developer and have laptop with 4GB RAM. When I compile my project the RAM is used at 100%.    If I add more RAM will it solve the problem? Finite Index of Subgroup of Subgroup Prove the following: If $H$ is a subgroup of finite index in a group $G$, and $K$ is a subgroup of $G$ containing $H$, then $K$ is of finite index in $G$ and $[G:H] = [G:K][K:H]$.  So this is basically a bijective proof? The number of cosets of $H$ in $G$ equals the number of cosets of $K$ in $G$ times the number of cosets of $H$ in $K$ by the multiplication principle?   Reference: Fraleigh p. 103  Question 10.35 in A First Course in Abstract Algebra How can I make a gameObject "stick" to another gameObject after it has collided with it? How can I make a gameObject "stick" to another gameObject after it has collided with it? Right now the gameObject just passes through! [C#] Why is it that scanf() needs the l in "%lf" when reading a double, when printf() can use "%f" regardless of whether its argument is a double or a float?  Example code:  double d; scanf("%lf", &amp;d); printf("%f", d); about how to open a URL in your default browser using the Terminal. Basically, you use the command   xdg-open http://google.com   My default browser is Firefox. But lets say that I wanted to open a specific website in Chrome, instead of Firefox. Is there a command to open it in Chrome instead of Firefox? Show that $\langle 2,x \rangle$ is not a principal ideal in $\mathbb Z [x]$ Hi I don't know how to show that $\langle 2,x \rangle$ is not principal and the definition of a principal ideal is unclear to me. I need help on this, please.   The ring that I am talking about is $\mathbb{Z}[x]$ so $\langle 2,x \rangle$ refers to $2g(x) + xf(x)$ where $g(x)$, $f(x)$ belongs to $\mathbb{Z}[x]$. According to Ohm's Law, if the resistance is zero, the power dissipated by a resistor is unmeaning.  $$P_d = R \times I^2$$  $$I = \sqrt{ \frac {P_d}{R} }$$  Can one calculate the resistance given that power is defined? Only by knowing power, how can one calculate the maximum current of a zero-Ohm resistor?   I'm a bit confused as I've seen there is zero-Ohm resistors with specified power in the market. proof of binomial identity involving double sum Are there any tools that I can use to defrag my Windows partition from Linux? How does Cooper get out of the black hole? In the movie Interstellar,  Cooper (played by ) enters a black hole and sends a message to Murph (his daughter). Later, he is found by rangers, but I don't understand how he gets out of the black hole?  As far as I know, nothing can get out of a black hole, as it has extremely high gravity. In the late 1970s I bought a book at a school book fair (likely published by Scholastic) about a young boy who lived on a generational starship.  The ship was failing.  I remember some bit about an icey cold airlock.  One of the constellations (Cygnus) somehow took on actual fleshy form and manifested as a talking swan, which somehow helped the starships reach their destination.  Pointers? Using CLI, how do I change the user's profile picture? A similar task for changing the desktop background, can be achieved using the following script:   FILE="/backgrounds/background.png" gsettings set org.gnome.desktop.background picture-uri "$FILE"   How would I achieve the same result, but with the user's avatar/profile picture? Where, how and when I can acquire HM's?