how to hide a page from being seen in wordpress backend and frontend -


In my plugin I have created a custom template that prints a requested sidebar. And to run this template's code, I updated it to a custom page (by calling update_metadata).
Is there a good idea to get content of a specific sidebar in Ajax call?
Now my problem is that the WordPress show is in this dashboard and front page, and after searching, I do not find it easy to understand the solution to completely hide a page so that it is accessed only by its ID Can go Will someone tell me how to do this?

You are going wrong about this, you can create a function that does anything Can be created on any WordPress page that you can create.

But if you can actually create a page outside the database, then:

  add_action ('init', 'add_rewrite_rule'); Function add_rewrite_rule () {// add_rewrite_rule (REEGEX URL, location, priority (i.e. top is before other rewrite rules) / I created a custom post type for this plugin which is called market - which you want To add post_type with a query word to add basically wordress in the sidebar url add_rewrite_rule ('^ sidebar?', 'Index.php? Is_ sidebar_page = 1 and post_type = market', 'top'); } // a query var add_action ('query_vars',' Market_set_query_var ''); function marke T_set_query_var ($ vars) {array_push ($ vars, 'is_ sidebar_page'); return $ vars;} // Associate a template with your quer_var add_filter ('template_include', 'market_include_template', 1000, 1)); Function market_include_template ($ template) {if (get_query_var ('is_sidebar_page')) {$ new_template = (theme or plugin path). '/ Pages / yourpage.php'; // If you change this path in your file (file_exists ($ New_template)) $ template = $ new_template;} return template;}  

this will not be a page that is in the admin section Will be or will be related to any query, but anyone can navigate to this page. But as I said above, you would be better to create a function to create your sidebar. If you want a different file to handle "View", then you use require_once 'filename'; Keep a file and your work area free from html.

If you create a function in a WordPress plugin, do not forget that many functions can not be available later in the load process. If you run in any undefined functions, use Add_action ()

Edit:

You are loading WordPress before reaching the template so that you have all the functions . (Google WP loads for more info) + get_header () / get_footer () CSS, etc. will load some things like In the above code I had a small typo, was fixed but basically what you are doing if someone is saying WordPress Query_var (rewrite rules) to apply www.example.com/sidebar on the word WordPress View saved wars (final function) and will return template ashock. The second function only registers the register

You also have wp_functions in any file that you create and include in a plugin, etc. So why you can create a file that is similar to this page.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -