PluginProbe
Code Snippets / 2.14.6
Code Snippets v2.14.6
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / functions.php

functions.php in Code Snippets 2.14.6, at php/functions.php

72 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Fetch the admin menu slug for a snippets menu
5 *
6 * @deprecated Use code_snippets()->get_menu_slug() instead
7 *
8 * @param string $menu The menu to retrieve the slug for
9 *
10 * @return string The menu slug
11 */
12 function code_snippets_get_menu_slug( $menu = '' ) {
13 return code_snippets()->get_menu_slug( $menu );
14 }
15
16 /**
17 * Fetch the URL to a snippets admin menu
18 *
19 * @deprecated Use code_snippets()->get_menu_url() instead
20 *
21 * @param string $menu The menu to retrieve the URL to
22 * @param string $context The URL scheme to use
23 *
24 * @return string The menu URL
25 */
26 function code_snippets_get_menu_url( $menu = '', $context = 'self' ) {
27 return code_snippets()->get_menu_url( $menu, $context );
28 }
29
30 /**
31 * Fetch the admin menu slug for a snippets menu
32 *
33 * @deprecated Use code_snippets()->get_snippet_edit_url() instead
34 *
35 * @param int $snippet_id The snippet
36 * @param string $context The URL scheme to use
37 *
38 * @return string The URL to the edit snippet page for that snippet
39 */
40 function get_snippet_edit_url( $snippet_id, $context = 'self' ) {
41 return code_snippets()->get_snippet_edit_url( $snippet_id, $context );
42 }
43
44 /**
45 * Get the required capability to perform a certain action on snippets.
46 * Does not check if the user has this capability or not.
47 *
48 * If multisite, checks if *Enable Administration Menus: Snippets* is active
49 * under the *Settings > Network Settings* network admin menu
50 *
51 * @deprecated Use code_snippets()->get_cap() instead
52 * @since 2.0
53 * @return string The capability required to manage snippets
54 */
55 function get_snippets_cap() {
56 return code_snippets()->get_cap();
57 }
58
59 /**
60 * Return the appropriate snippet table name
61 *
62 * @deprecated Use code_snippets()->db->get_table_name() instead
63 * @since 2.0
64 *
65 * @param string|bool|null $multisite Retrieve the multisite table name or the site table name?
66 *
67 * @return string The snippet table name
68 */
69 function get_snippets_table_name( $multisite = null ) {
70 return code_snippets()->db->get_table_name( $multisite );
71 }
72