Hello, you could find guide here as said by WP Yogi – http://codex.ww.wp.xz.cn/Writing_a_Plugin. I’m also starting to write a plugin for Gmail Login blog, if you get some more resources, also share with me.
@jafardhada – please be aware that using these forums to post unnecessary links to your site is not permitted. They will be deleted.
Might also want to review using ‘gmail’ in a url as it’s a trademark of a rather large multibillion dollar corporation that has a very large legal dept. π
Edit: Mod removed link…
I’ve checked out the writing a plugin page, but what I’m hoping to find is a simple plugin example that has somewhat similar functionality that I can toy around with. I’ve already created this functionality when I learned how to use custom fields, but I would like a more user friendly way to enter the data and not have it limited to the theme. I’m thinking that once I learn how to create meta-boxes with a plugin, that would open the door for me to be able to create a whole slew of useful plugins.
Which leads me to my next question lol is it possible to use meta-boxes to fill in data for custom fields? I’m almost positive this is plausible but just want to make sure lol
this is what I have so far lol
<?php
/*
Plugin Name: custom meta box
Plugin URI: http://ww.wp.xz.cn
Description: This plugin adds a custom meta box to the post page on the admin panel that allows user to enter post related data.
Version: Beta
Author: Russ Powers
Author URI: http://ww.wp.xz.cn
*/
?>
<?php
add_action( 'add_meta_boxes', 'cd_meta_box_add' );
function cd_meta_box_add() {
add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );
}
?>
<?php
function cd_meta_box_cb( $post ) {
$values = get_post_custom( $post->ID );
$text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : β;
$selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : β;
$check = isset( $values['my_meta_box_check'] ) ? esc_attr( $values['my_meta_box_check'][0] ) : β;
<p>
<label for="my_meta_box_text">Text Label</label>
<input type="text" name="my_meta_box_text" id="my_meta_box_text" value="<?php echo $text; ?>" />
</p>
}
?>
Have you looked at these?
http://ww.wp.xz.cn/plugins/search.php?q=meta+boxes
(Sorry for the diversion above, BTW.)
No worries, I completely understand the diversion π I made sure to replace my URL’s with ww.wp.xz.cn in the code snippet above lol I was able to get the code above to work for a split second, generated the metabox and everything – but I had some code showing up at the top of all the pages in the admin panel.
I’ve checked out a few of the pre-existing meta-box plugins but some of them are a little to complicated for me to find the very basic functions and syntax required. I’ve been looking for a plugin that adds a single meta-box for something silly like current mood or current song but haven’t found anything useful lol
How about the Codex –
http://codex.ww.wp.xz.cn/Function_Reference/add_meta_box
I’m really not the one to help with code questions and you will likely get better help on the Hacks forum for something like this.
http://ww.wp.xz.cn/support/forum/hacks