forked from mAAdhaTTah/wordpress-github-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.php
46 lines (40 loc) · 1.13 KB
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Theme helper functions.
*
* @package WordPress_GitHub_SYnc
*/
/**
* Returns the HTML markup to view the current post on GitHub.
*
* @return string
*/
function get_the_github_view_link() {
return '<a href="' . get_the_github_view_url() . '">' . apply_filters( 'wpghs_view_link_text', 'View this post on GitHub.' ) . '</a>';
}
/**
* Returns the URL to view the current post on GitHub.
*
* @return string
*/
function get_the_github_view_url() {
$wpghs_post = new WordPress_GitHub_Sync_Post( get_the_ID(), WordPress_GitHub_Sync::$instance->api() );
return $wpghs_post->github_view_url();
}
/**
* Returns the HTML markup to edit the current post on GitHub.
*
* @return string
*/
function get_the_github_edit_link() {
return '<a href="' . get_the_github_edit_url() . '">' . apply_filters( 'wpghs_edit_link_text', 'Edit this post on GitHub.' ) . '</a>';
}
/**
* Returns the URL to edit the current post on GitHub.
*
* @return string
*/
function get_the_github_edit_url() {
$wpghs_post = new WordPress_GitHub_Sync_Post( get_the_ID(), WordPress_GitHub_Sync::$instance->api() );
return $wpghs_post->github_edit_url();
}