Module: Wpxf::WordPress::Urls
- Included in:
- Module
- Defined in:
- lib/wpxf/wordpress/urls.rb
Overview
Provides helper methods for generating commonly used WordPress URLs.
Instance Method Summary collapse
-
#wordpress_url_admin ⇒ String
The WordPress admin URL.
-
#wordpress_url_admin_ajax ⇒ String
The WordPress admin AJAX URL.
-
#wordpress_url_admin_options ⇒ String
The admin / plugin options URL.
-
#wordpress_url_admin_post ⇒ String
The WordPress admin post URL.
-
#wordpress_url_admin_profile ⇒ String
The edit profile page URL.
-
#wordpress_url_admin_update ⇒ String
The WordPress admin update URL.
-
#wordpress_url_atom ⇒ String
The WordPress ATOM URL.
-
#wordpress_url_author(author_id) ⇒ String
The WordPress author URL.
-
#wordpress_url_comments_post ⇒ String
The comment poster URL.
-
#wordpress_url_login ⇒ String
The WordPress login URL.
-
#wordpress_url_new_user ⇒ String
The WordPress new user URL.
-
#wordpress_url_opml ⇒ String
The WordPress OPML URL.
-
#wordpress_url_plugin_install ⇒ String
The WordPress plugin install URL.
-
#wordpress_url_plugin_upload ⇒ String
The WordPress plugin uploader URL.
-
#wordpress_url_plugins ⇒ String
The WordPress plugins URL.
-
#wordpress_url_post(post_id) ⇒ String
The URL of the specified WordPress post.
-
#wordpress_url_rdf ⇒ String
The WordPress RDF URL.
-
#wordpress_url_readme ⇒ String
The WordPress readme file URL.
-
#wordpress_url_rest_api ⇒ String
The base path of the REST API introduced in WordPress 4.7.0.
-
#wordpress_url_rss ⇒ String
The WordPress RSS URL.
-
#wordpress_url_sitemap ⇒ String
The WordPress sitemap URL.
-
#wordpress_url_themes ⇒ String
The WordPress themes URL.
-
#wordpress_url_uploads ⇒ String
The WordPress uploads directory.
-
#wordpress_url_wp_content ⇒ String
The WordPress wp-content URL.
-
#wordpress_url_xmlrpc ⇒ String
The WordPress XMLRPC URL.
Instance Method Details
#wordpress_url_admin ⇒ String
Returns the WordPress admin URL.
53 54 55 |
# File 'lib/wpxf/wordpress/urls.rb', line 53 def wordpress_url_admin normalize_uri(full_uri, 'wp-admin/') end |
#wordpress_url_admin_ajax ⇒ String
Returns the WordPress admin AJAX URL.
58 59 60 |
# File 'lib/wpxf/wordpress/urls.rb', line 58 def wordpress_url_admin_ajax normalize_uri(wordpress_url_admin, 'admin-ajax.php') end |
#wordpress_url_admin_options ⇒ String
Returns the admin / plugin options URL.
128 129 130 |
# File 'lib/wpxf/wordpress/urls.rb', line 128 def normalize_uri(wordpress_url_admin, 'admin.php') end |
#wordpress_url_admin_post ⇒ String
Returns the WordPress admin post URL.
63 64 65 |
# File 'lib/wpxf/wordpress/urls.rb', line 63 def wordpress_url_admin_post normalize_uri(wordpress_url_admin, 'admin-post.php') end |
#wordpress_url_admin_profile ⇒ String
Returns the edit profile page URL.
113 114 115 |
# File 'lib/wpxf/wordpress/urls.rb', line 113 def wordpress_url_admin_profile normalize_uri(wordpress_url_admin, 'profile.php') end |
#wordpress_url_admin_update ⇒ String
Returns the WordPress admin update URL.
68 69 70 |
# File 'lib/wpxf/wordpress/urls.rb', line 68 def wordpress_url_admin_update normalize_uri(wordpress_url_admin, 'update.php') end |
#wordpress_url_atom ⇒ String
Returns the WordPress ATOM URL.
33 34 35 |
# File 'lib/wpxf/wordpress/urls.rb', line 33 def wordpress_url_atom normalize_uri(full_uri, 'feed/atom/') end |
#wordpress_url_author(author_id) ⇒ String
Returns the WordPress author URL.
18 19 20 |
# File 'lib/wpxf/wordpress/urls.rb', line 18 def () normalize_uri(full_uri, "?author=#{}") end |
#wordpress_url_comments_post ⇒ String
Returns the comment poster URL.
123 124 125 |
# File 'lib/wpxf/wordpress/urls.rb', line 123 def wordpress_url_comments_post normalize_uri(full_uri, 'wp-comments-post.php') end |
#wordpress_url_login ⇒ String
Returns the WordPress login URL.
6 7 8 |
# File 'lib/wpxf/wordpress/urls.rb', line 6 def wordpress_url_login normalize_uri(full_uri, 'wp-login.php') end |
#wordpress_url_new_user ⇒ String
Returns the WordPress new user URL.
103 104 105 |
# File 'lib/wpxf/wordpress/urls.rb', line 103 def wordpress_url_new_user normalize_uri(wordpress_url_admin, 'user-new.php') end |
#wordpress_url_opml ⇒ String
Returns the WordPress OPML URL.
48 49 50 |
# File 'lib/wpxf/wordpress/urls.rb', line 48 def wordpress_url_opml normalize_uri(full_uri, 'wp-links-opml.php') end |
#wordpress_url_plugin_install ⇒ String
Returns the WordPress plugin install URL.
93 94 95 |
# File 'lib/wpxf/wordpress/urls.rb', line 93 def wordpress_url_plugin_install normalize_uri(wordpress_url_admin, 'plugin-install.php') end |
#wordpress_url_plugin_upload ⇒ String
Returns the WordPress plugin uploader URL.
98 99 100 |
# File 'lib/wpxf/wordpress/urls.rb', line 98 def wordpress_url_plugin_upload normalize_uri(wordpress_url_admin, 'plugin-install.php?tab=upload') end |
#wordpress_url_plugins ⇒ String
Returns the WordPress plugins URL.
78 79 80 |
# File 'lib/wpxf/wordpress/urls.rb', line 78 def wordpress_url_plugins normalize_uri(wordpress_url_wp_content, 'plugins') end |
#wordpress_url_post(post_id) ⇒ String
Returns the URL of the specified WordPress post.
12 13 14 |
# File 'lib/wpxf/wordpress/urls.rb', line 12 def wordpress_url_post(post_id) normalize_uri(full_uri, "?p=#{post_id}") end |
#wordpress_url_rdf ⇒ String
Returns the WordPress RDF URL.
28 29 30 |
# File 'lib/wpxf/wordpress/urls.rb', line 28 def wordpress_url_rdf normalize_uri(full_uri, 'feed/rdf/') end |
#wordpress_url_readme ⇒ String
Returns the WordPress readme file URL.
38 39 40 |
# File 'lib/wpxf/wordpress/urls.rb', line 38 def wordpress_url_readme normalize_uri(full_uri, 'readme.html') end |
#wordpress_url_rest_api ⇒ String
Returns the base path of the REST API introduced in WordPress 4.7.0.
118 119 120 |
# File 'lib/wpxf/wordpress/urls.rb', line 118 def wordpress_url_rest_api normalize_uri(full_uri, 'wp-json') end |
#wordpress_url_rss ⇒ String
Returns the WordPress RSS URL.
23 24 25 |
# File 'lib/wpxf/wordpress/urls.rb', line 23 def wordpress_url_rss normalize_uri(full_uri, '?feed=rss2') end |
#wordpress_url_sitemap ⇒ String
Returns the WordPress sitemap URL.
43 44 45 |
# File 'lib/wpxf/wordpress/urls.rb', line 43 def wordpress_url_sitemap normalize_uri(full_uri, 'sitemap.xml') end |
#wordpress_url_themes ⇒ String
Returns the WordPress themes URL.
83 84 85 |
# File 'lib/wpxf/wordpress/urls.rb', line 83 def wordpress_url_themes normalize_uri(wordpress_url_wp_content, 'themes') end |
#wordpress_url_uploads ⇒ String
Returns the WordPress uploads directory.
108 109 110 |
# File 'lib/wpxf/wordpress/urls.rb', line 108 def wordpress_url_uploads normalize_uri(wordpress_url_wp_content, 'uploads') end |
#wordpress_url_wp_content ⇒ String
Returns the WordPress wp-content URL.
73 74 75 |
# File 'lib/wpxf/wordpress/urls.rb', line 73 def wordpress_url_wp_content normalize_uri(full_uri, wp_content_dir) end |
#wordpress_url_xmlrpc ⇒ String
Returns the WordPress XMLRPC URL.
88 89 90 |
# File 'lib/wpxf/wordpress/urls.rb', line 88 def wordpress_url_xmlrpc normalize_uri(full_uri, 'xmlrpc.php') end |