Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 50523c1

Browse files
committed
Add #wordpress_url_admin_options
1 parent 8f48ee1 commit 50523c1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/wpxf/wordpress/urls.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,9 @@ def wordpress_url_rest_api
123123
def wordpress_url_comments_post
124124
normalize_uri(full_uri, 'wp-comments-post.php')
125125
end
126+
127+
# @return [String] the admin / plugin options URL.
128+
def wordpress_url_admin_options
129+
normalize_uri(wordpress_url_admin, 'admin.php')
130+
end
126131
end

spec/wordpress/urls_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,11 @@
181181
expect(subject.wordpress_url_comments_post).to eq url
182182
end
183183
end
184+
185+
describe '#wordpress_url_admin_options' do
186+
it 'returns the admin / plugin options URL' do
187+
url = 'http://127.0.0.1/wp/wp-admin/admin.php'
188+
expect(subject.wordpress_url_admin_options).to eq url
189+
end
190+
end
184191
end

0 commit comments

Comments
 (0)