How to append short url to specific external links

Mostly from https://stackoverflow.com/questions/7118823/check-if-url-has-certain-string-with-php Check if the url has your string, then spit something different out based on it. Perhaps something like… $url=”http://” . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]; if (false !== strpos($url,’forms.woo.com’)) { echo ‘?pageurl=” . home_url() . get_the_ID(); // there”s your page id url } else { the_permalink(); // plain old permalink }

Use “name” query string to refer to form field instead of pagename

When handling form submissions, it would generally be advisable to POST your form to a custom AJAX handler or wp-admin/admin-post.php form handler. If an external API integration requires you to accept the name parameter, setting up this functionality as a REST API endpoint or controller would give you fairly complete control over the query vars. … Read more

when the incoming url is a query, in which function does WP begin to work with it?

Any url that doesn’t point to a file/directory that actually exists is redirected (by .htaccess) to the index.php in the root of your WordPress install. index.php is what actually loads WordPress and its settings etc. It then calls the function wp();, which is responsible for initialising WordPress’ actually handling of the request. wp() is little … Read more

Pass query string to page

This should actually work for you: function header_resized_img () { $image = wp_get_image_editor($_GET[‘path’]); $height = $_GET[‘height’]; $width = $_GET[‘width’]; if (!is_wp_error($image)) { $image->resize(9999, $height, false); $orig_size = $image->get_size(); $image->crop($orig_size[‘width’]/2-$width/2, $orig_size[‘height’]/2-$height/2, $width, $height); $image->stream( $mime_type=”image/jpeg”); } } and include your function somewhere in the template: header_resized_img(); Then try accessing this URL: http://example.com/image/?width=500&height=400&path=some-url To generate your image.