August 2017
Beginner
412 pages
10h 30m
English
Now that the users are able to edit the list of supported document types by appending the document types they want, we should have a way of telling the doctype_styles_new_regex() function to use the user's list instead of the built-in list. To do so, we need to use get_option('doctype_styles_new_supportedtypes') in our doctype_styles_new_regex() function. The get_option() function will retrieve the value that the user has saved in the new option we just created. Modify your doctype_styles_new_regex() function so that it looks like this:
function ahs_doctypes_regex($text) { $types = get_option('doctype_styles_new_supportedtypes'); $types = preg_replace('/,\s*/', '|', $types); $text = preg_replace('/href=([\'|"][[:alnum:]| ...Read now
Unlock full access