I have made a simple code that will only save to a simple database. I have this code: register_activation_hook(samplePath, 'sample_install'); add_action('admin_menu', 'main'); add_action('user_admin_menu', 'main'); and a function like this : function main(){ <?php if (current_user_can('smessage')) { echo("admin");} else{ if(current_user_can('rmessage')){ echo("other user"); } } } and this the sample_install function from another php file : $wpdb->query($structure); $a = get_role('administrator'); $a->add_cap('smessage'); $s = get_role('author'); $s->add_cap('rmessage'); I can see the code if I login as an adminstrator but using other roles like author, subscriber, I couldn't see the plugin any more...can someone help me with this? I'm new in using wordpress... Thank you …

Member Avatar
Member Avatar
+0 forum 1

I have a code: <body> <?php global $wpdb; $sql = ""; $sql = "SELECT * FROM emgAdmin"; $sql = "$sql INNER JOIN wp_posts ON wp_posts.ID = emgAdmin.ID_OfPost "; $ArrResult = $wpdb->get_results($sql); while ($emgAdminResult = mysql_fetch_object($ArrResult)) { echo($emgAdminResult->post_date); } ?> </body> and I'm getting an error that says,"Call to a member function get_results() on null" ... I have tested the sql and it did worked, rendering all that data that I wanted. I dont know why I'm getting the error with the get_results() function of wordpress when I have already defined the global $wpdb

Member Avatar
Member Avatar
+0 forum 6

I believe everyone heard the news from November the 11th-"Opening up Visual Studio and .NET to Every Developer, Any Application: .NET Server Core open source and cross platform, Visual Studio Community 2013 and preview of Visual Studio 2015 and .NET 2015". Maybe some people will disagree but I think that Visual Studio is the best IDE ever developed. I was never a fan of Microsoft but Microsoft is always present (software, programming languages) at universities, high schools, aditional education ect... For this reason I've chosen C# to be my primary language (sorry for going of topic). After I read this …

Member Avatar
Member Avatar
+0 forum 1

First things first, the story about this article. Recently I've created an Wordpress Plugin [WordPress - WP - Keywords To Tooltip | CodeCanyon](http://codecanyon.net/item/wp-keywords-to-tooltip/6513598) After a few days, somebody asked me if it's working with Wordpress Multi Site, initially scared, I didn't expect it to be so easy, I've achieved the transition and make it compatible in under an hour. Why ? Because all the code written was OOP, so it was a piece of cake to modify where needed public function _activationHook() { global $wpdb; $query = file_get_contents($this->scriptBasePath . 'model/install.sql'); $query = str_replace($this->database->_table_prefix , $wpdb->base_prefix . $this->database->_table_prefix, $query); $queries = …

Member Avatar
Member Avatar
+2 forum 3

Hi Everyone, I am needing some help with a wordpress insert query. I have this update query $qry ="UPDATE `".$wpdb->prefix."comments_real` SET `comment_country` = '$country',`comment_number` = '$phone',`comment_smvcode` = '$ref' WHERE `wp_comments`.`comment_ID` =$comment_id"; how do I change this to insert a new record in a db table called "comments_real" Thanks in advance

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm new with WordPress plugin development, I try to login and install a plugin with the WP user credentials without using login panel just like managewp.com people do.., they ask me for my site name,username,pwd then they automatically install their own plugin to my WordPress and one more thing i add a capcha for login panel, but still they pass it and install their plugin Please help me out, i'm stuck in this from last 5 days .. Thanks

Member Avatar
Member Avatar
+0 forum 10

The End.