{"id":17075,"date":"2012-02-25T06:51:37","date_gmt":"2012-02-25T06:51:37","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wordpress-registry\/"},"modified":"2012-09-12T12:27:24","modified_gmt":"2012-09-12T12:27:24","slug":"wordpress-registry","status":"closed","type":"plugin","link":"https:\/\/nn.wordpress.org\/plugins\/wordpress-registry\/","author":7389901,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.4","stable_tag":"trunk","tested":"3.4.2","requires":"1.5","requires_php":"","requires_plugins":"","header_name":"Wordpress Registry","header_author":"Rubin Shrestha","header_description":"","assets_banners_color":"","last_updated":"2012-09-12 12:27:24","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/www.rubin.com.np","rating":5,"author_block_rating":0,"active_installs":10,"downloads":2065,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[32175,32176,19988,32337,50825],"plugin_category":[],"plugin_contributors":[93305],"plugin_business_model":[],"class_list":["post-17075","plugin","type-plugin","status-closed","hentry","plugin_tags-_get","plugin_tags-_post","plugin_tags-globals","plugin_tags-registry","plugin_tags-scope","plugin_contributors-rbncha","plugin_committers-rbncha"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wordpress-registry.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The main reason for building this plugin is because wordpress doesn't readily have a central registry system where things can be stored such as variable values, objects, arrays. Which can be retrieved from a global space. This plugin basically tries to  lessen the repeating declarations of variables and etc. It is something quite similar to Magento registry \"Mage_Registry\", but very light version.<\/p>\n\n<p>This plugin can also be used as GET and POST request parameters handler. The benefit is, you don't have to check isset($_GET['myparam']) or isset($_POST['myparam']). If the param is not set, it will return a default value you supplied in second param. By default, the default value is false.<\/p>\n\n<p>Handle the session data as easy as never before. Save to session, check existance, get, unset it easily using dynamic methods.<\/p>\n\n<p>Hope this could be of some use.<\/p>\n\n<p>Usage is very easy, neat and straight forward:<\/p>\n\n<p>Register a dynamic method on the fly:\n    registry()-&gt;setDynamicMethodName('this is my value');\n    registry()-&gt;setMyName('My Name is Rubin Shrestha');<\/p>\n\n<p>Validate existance of your method and echo:\n    if( registry()-&gt;hasDynamicMethodName() ) echo 'Has ' . registry()-&gt;getDynamicMethodName();<\/p>\n\n<p>Unset the dynamic method:\nregistry()-&gt;unsDynamicMethodName(); after this, if you echo registry()-&gt;getDynamicMethodName() it will return null;<\/p>\n\n<p>For GET and POST request handler use it like this:<\/p>\n\n<ul>\n<li>For $_GET, you can simply call registry()-&gt;request()-&gt;getParam('param_key', [default value if any, else blank, will return false]);<\/li>\n<li>To check if the page type is $_POST use if( registry()-&gt;request()-&gt;isPost() ) { \/\/do your stuffs here }<\/li>\n<li>For $_POST, you can simply call registry()-&gt;request()-&gt;getPost('param_key', [default value if any, else blank; will return false]);<\/li>\n<li>You can also do registry()-&gt;request()-&gt;getParams() and registry()-&gt;request()-&gt;getPosts();<\/li>\n<li>You can also add request object scope variable, registry()-&gt;request()-&gt;setVariableName('this is my value');. Get the value by registry()-&gt;request()-&gt;getVariableName();<\/li>\n<\/ul>\n\n<p>Session handler:<\/p>\n\n<p>Handle the data in session as easy as registry()-&gt;session()-&gt;setDynamicMethodName('this is my value'); and get it as registry()-&gt;session()-&gt;getDynamicMethodName(); Unset it registry()-&gt;session()-&gt;unsDynamicMethodName();<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload Wordpress Registry to the '\/wp-content\/plugins\/' directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>2.4<\/h4>\n\n<ul>\n<li>registry()-&gt;request()-&gt;session() handler hadded<\/li>\n<\/ul>\n\n<h4>2.3<\/h4>\n\n<ul>\n<li>registry()-&gt;request()-&gt;isPost() method added to check if a page request is <\/li>\n<\/ul>\n\n<h4>2.2<\/h4>\n\n<ul>\n<li>Quick fix for POST values not being retrieved<\/li>\n<\/ul>\n\n<h4>2.1<\/h4>\n\n<ul>\n<li>Introduction of better GET and POST request hanlder.<\/li>\n<li>Notice error removed while initializing plugin itself<\/li>\n<\/ul>\n\n<h4>2.0<\/h4>\n\n<ul>\n<li>Introduced method based implementation as set\/get\/has Data so that you can use registry()-&gt;setObjectName(new stdObject), registry()-&gt;hasObjectName() registry()-&gt;getObjectName() etc.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial Release<\/li>\n<\/ul>","raw_excerpt":"Makes variables and values globally accessible from everywhere. Better handling of $_GET and $_POST. Session data management.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/17075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=17075"}],"author":[{"embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rbncha"}],"wp:attachment":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=17075"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=17075"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=17075"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=17075"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=17075"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=17075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}