Support » Plugin: Jayj Quicktag » how do you save the fields in options.php?

  • Resolved clickmac

    (@clickmac)


    first off i love this plugin, especially how u can click add a button and new fields come out at you. I would like to know, how does it work? how does it do that?

    I have created a simple scenario
    here:

    <form action="options.php" method="post">
    
    <table class="widefat my-table" border="1">
    
    <thead>
    	<tr>
    		<th>My Label</th>
    		<th>My text</th>
    	</tr>
    </thead>
    
    <tbody>
    
    <?php
                    	if ( isset( $options['buttons'] ) ) :
    
    					// Loop through all the buttons
                    	for ( $i = 0; $i < count( $options['buttons'] ); $i++ ) :
    
                    		if ( ! isset( $options['buttons'][$i] ) )
                    			break;
                    ?>
    
       <tr valign="top" class="my-row">
    <td class="my-order" title="<?php esc_attr_e( 'Change order' ); ?>"><?php echo $i; ?></td>
    
    <td><input type="text" name="my_settings[buttons][<?php echo $i; ?>][text]" value="<?php echo esc_attr( $options['buttons'][$i]['text'] ); ?>" /></td>
                            <td><input type="text" name="my_settings[buttons][<?php echo $i; ?>][title]" value="<?php echo esc_attr( $options['buttons'][$i]['title'] ); ?>" /></td>
    
    <td class="my-remove"><a class="my-remove-button" href="javascript:;" title="<?php esc_attr_e( 'Remove Field' ); ?>">&times;</a></td>
       </tr>
    <?php endfor; endif; ?>
    <!-- Empty -->
                        <?php $i = 999; ?>
    <tr valign="top" class="my-clone">
    
    <td class="my-order" title="<?php esc_attr_e( 'Change order' ); ?>"><?php echo $i; ?></td>
    <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
    
           <td><input type="text" name="my_settings[buttons][<?php echo $i; ?>][text]" title="<?php esc_attr_e( 'Label of the Quicktag' ); ?>" value="" /></td>
                            <td><input type="text" name="my_settings[buttons][<?php echo $i; ?>][title]" title="<?php esc_attr_e( 'Title attribute of the Quicktag' ); ?>" value="" /></td>
    
    <td class="my-remove"><a class="my-remove-button" href="javascript:;" title="<?php esc_attr_e( 'Remove button' ); ?>">&times;</a></td>
    
       </tr>
    
    </tbody>
    
    <tfoot>
    	<tr>
    	</tr>
    
    <td><a href="javascript:;" id="my-add-button" class="button-secondary"><?php _e( '+ Add New button' ); ?></a></td>
    
    </tfoot>
    
    </table>
    </form>

    of course with the javascript on the next file….javascript works, I would just like to know does it save?

    after clicking save changes, it saves options.php is not found…

    what functions do i put before it….

    http://wordpress.org/extend/plugins/jayj-quicktag/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘how do you save the fields in options.php?’ is closed to new replies.