WordPress slug issue with non-latin characters

Permalinks like http://example/שָׁלוֹם are actually working in my WordPress 3.3. Could be the remove_accents() improvements for i18n permalinks. As Sean & Steve noted, make sure you’re using WordPress ≥ 3.3 make sure your .htaccess file contains a rule similar to RewriteRule . /index.php [L] check that your database is UTF-8 encoded (and consider converting to … Read more

Can I use REST-API on plain permalink format?

Yes you can. Just add the rest_route query parameter. So https://wordpress.org/wp-json/ would become https://wordpress.org/?rest_route=/ Or https://wordpress.org/wp-json/wp/v2/ would become https://wordpress.org/?rest_route=/wp/v2 to give you a more complete example. So you’re wondering how to decide which one to use? Worry no more, there’s a function for that: get_rest_url() Another option is the fact that by default there is … Read more

How can I get the privacy policy page?

WordPress stores the page id for the privacy policy page in the options table. To get the value, you can use: $privacy_policy_page = get_option( ‘wp_page_for_privacy_policy’ ); if( $privacy_policy_page ) { $permalink = esc_url( get_permalink( $privacy_policy_page ) ); } The $privacy_policy_page variable holds the ID of the privacy policy page.

Get page permalink without wpurl

There’s nothing built in to return the bit you want but it should be as easy as using the home_url() function and removing it’s output from the full url eg: function get_relative_permalink( $url ) { return str_replace( home_url(), “”, $url ); }

Get current URL (permalink) without /page/{pagenum}/

You can get the current URL through home_url( $wp->request ). Try the example below: global $wp; // get current url with query string. $current_url = home_url( $wp->request ); // get the position where ‘/page.. ‘ text start. $pos = strpos($current_url , ‘/page’); // remove string from the specific postion $finalurl = substr($current_url,0,$pos); echo $finalurl;

WordPress matching URLs with trailing tildes

Let’s go simple If I understand OP well, your problem is that urls containing a tilde are matched at all. All other answers focus on the fact that sanitization for query strips out some characters before perform the query, however one should be capable to prevent a rewrite rule to don’t match under some circumstances. … Read more

What is the difference between get_post_permalink and get_permalink?

The get_post_permalink() funciton fetches the link to a post depending on its “permanent” link plus your custom rewrite rules that changes ?p=123 into for e.g. my-beautiful-sunday-diary. The get_permalink() function is more “basic” but as well more versatile in what it does: For a post_type of page, it uses get_page_link() attachment, it uses get_attachment_link() post, it … Read more

Permalink format: singular or plural

There’s a simple rule that I follow (it’s hard to explain, so I’ll give examples): http://example.com/categories/ <– This plural form should mean that the page shows a list of all the categories in use on your site. Similarly, if it’s “authors” (as in http://example.com/authors/), I’d expect the page to show a list (with or without … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)