Read the following post in order to be able to limit editing and viewing post or post-types to post creator only:

01. https://premium.wpmudev.org/blog/how-to-limit-the-wordpres-posts-screen-to-only-show-authors-their-own-posts/

02. This is the plugin:

<?php
/*
Plugin Name: Simplify Post Edit List
Description: Show only the author's posts in the edit list
Version: 0.1
License: GPL
Author: Sarah Gooding
Author URI: http://untame.net
*/

function mypo_parse_query_useronly( $wp_query ) {
    if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
        if ( !current_user_can( 'update_core' ) ) {
            global $current_user;
            $wp_query->set( 'author', $current_user->id );
        }
    }
}

add_filter('parse_query', 'mypo_parse_query_useronly' );

03. The line in red can be modified as follows:

a. Limit to Edit: strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false
b. Limit to All admin area: strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin' ) !== false
c. Limit to All admin area: strpos( $_SERVER[ 'REQUEST_URI' ], '/[Post-Type here]' ) !== false
d. Combination of IF: 
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin' ) !== false || 
strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false || 
strpos( $_SERVER[ 'REQUEST_URI' ], '/[post-type]' ) !== false )


 

Top 16 Best Looking jQuery Mobile Themes

Convert CSS to RTL

The simplest way is to add the following to each class of CSS:

  • direction: rtl; /* Align text to right */
  • float: right; /* the text will flow from right */
  • text-align: right; /* the text will be aligned from right */

 

WordPress themes

In general you can browse to wordpress developer resources.

1. Create a directory under your wordpress root\wp-content\plugins\ShortcodeDemo.

2. Create file called ShortcodeDemo.php.

3. Paste to ShortcodeDemo.php the following content:

<?php
/*
Plugin Name: Shortcode demo
Plugin URI:
Description: Shortcode Demo
Version: 1.0
Author: Gabriel Magen
Author URI: http://www.flash-jet.com
License: GPLv2
*/

add_shortcode( ‘fj’, ‘ch2ts_twitter_feed_shortcode’ );

function ch2ts_twitter_feed_shortcode( $atts ) {
$output = ‘<a href=”http://www.flash-jet.com”>
Flash-Jet</a>’;
return $output;
}

?>

4. Goto wordpress plugins and activate Shortcode demo plugin.

5. Create a post and write there [fj].

6. View the post at wordpress frontend and see the effect.

let’s create WordPress plugin the easy way:

01. Create plug-in template as follows:

  • Browse to http://wppb.me/ and generate plugin, this is Wordpress boilerplate generator  and generates OOP plugin.
  • Download the generated plug-in.
  • Install it.
  • In general here is a link to wordpress developer resources.

02. plugin code

  • Search plugin directory for string “public static function activate()“.
  • activation: in the activation phase we will install and create the wp_db table
  • find the “public static function activate()” and add code to create the db table
  • public static function activate() {
        /**Create an instance of the database class**/
        if (!isset($wpdb)) $wpdb = $GLOBALS['wpdb'];
        /**Set the custom table **/$table_name = $wpdb->prefix . "crud_links";
        $demo_browser_db_version = '1.0';
        /**Execute the sql statement to create or update the custom table**/
    
        if ( $wpdb->get_var("show tables like '$table_name'" ) != $table_name ) {
            $sql = "CREATE TABLE " . $table_name . " (
            ID int(11) NOT NULL AUTO_INCREMENT,
            Name varchar(255) DEFAULT NULL,
            Link varchar(255) DEFAULT NULL,
            LinkOrder int(11) NOT NULL,
            Description varchar(2255) DEFAULT NULL,
            OpenWindow tinyint(1) NOT NULL,
            PRIMARY KEY (ID)
            ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;";
            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
            dbDelta($sql);
            add_option( "my_plugin_db_version", '1.0' );
        }
    
    }
  • uninstall.php – when we remove the plugin this code will run
  • if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
        exit;global $wpdb;
        $table_name = $wpdb->prefix . "crud_links";
        $sql = "DROP TABLE IF EXISTS $table_name;";
        $wpdb->query($sql);
        delete_option("my_plugin_db_version");
    }
    
  • wp hooks – admin menu
  • Search plug-in directory for string private function define_admin_hooks().
  • Add to this function the following line of code:

$this->loader->add_action( ‘admin_menu’, $plugin_admin, ‘admin_menu’ );

  • this will call the function in admin folder
  • Add the following code to php file under admin directory, not the index.php file, this will create admin page:
    public function admin_menu() {
        add_menu_page("CRUD Operation", "Links Crud", 1, "admin_linkesmenu", array($this,"admin_links_display"));
    }
    function admin_links_display()
    {
        include('partials/general-links-admin-display.php');
    }
    
  • Php file under Directory Admin\Partials, general-links-admin-display.php, Insert all html + php code and CRUD action you need for back-end.
 <? php

/**
 * Provide a dashboard view for the plugin
 *
 * This file is used to markup the public-facing aspects of the plugin.
 *
 * @link: http://www.flash-jet.com
 * @since 1.0.0
 *
 * @package General_Links
 * @subpackage General_Links/admin/partials
 */
 ?>

 <!-- This file should primarily consist of HTML with a little bit of PHP. -->

<?php
global $wpdb; 
/**Set the custom table **/
$table_name = $wpdb->prefix . "crud";


$CN =mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Sorry Connection Problem");
$DB =mysql_select_db(DB_NAME,$CN) or die("Sorry Not Connect to Your Database");


if(isset($_POST['add']))
{
 $name=$_POST['name'];
 $link=$_POST['link'];
 $order=$_POST['order'];
 $description=$_POST['description'];
 $openwindow=$_POST['openwindow'];
 
 $sql="INSERT INTO wp_crud_links (`Name`, `Link`, `LinkOrder`, `Description`, `OpenWindow`) VALUES ('".$name."','".$link."','".$order."','".$description."','".$openwindow."')";
 $res=mysql_query($sql);
 if($res)
 {
 echo "<script>document.location='admin.php?page=admin_linkesmenu&msg=1'</script>";
 }
 else
 {
 echo "Error !";
 }
 
}

if(isset($_POST['Update']))
{
 $uid=$_GET['id'];

 $name=$_POST['name'];
 $link=$_POST['link'];
 $order=$_POST['order'];
 $description=$_POST['description'];
 $openwindow=$_POST['openwindow'];

 $sql="update wp_crud_links set Name='".$name."' , Address='".address."' , Mobile='".$mobile."' , Fileupload='".$image_name."' where ID='".$uid."'";
 $reg=mysql_query($sql);
 if($reg)
 {
 echo"<script>document.location='admin.php?page=admin_linkesmenu&msg=2'</script>";
 }
 else
 {
 echo"Error !";
 }
}
 
if($_GET['action'] == 'delete')
{

 $did=$_GET['id'];
 
 $sql1="delete from wp_crud_links where ID='".$did."'";
 $res1=mysql_query($sql1);
 if($res1)
 {
 echo"<script>document.location='admin.php?page=admin_linkesmenu&msg=3'</script>";
 }
 else
 {
 echo "Error !";
 } 
}
?>


<?php 
if(isset($_GET['action']) && ($_GET['action'] == 'edit'))
{
 $urid=$_GET['id'];
 $sql="select * from wp_crud_links where ID='".$urid."'";
 $reg=mysql_query($sql);
 $res=mysql_fetch_array($reg);
 $uname= $res['Name'];
 $ulink= $res['Link'];
 $uorder= $res['LinkOrder'];
 $udescription= $res['Description'];
 $uopenwindow= $res['OpenWindow'];
 
 ?>
 
<form name="add" action="" method="post">
<table cellpadding="5" cellspacing="5">
 <tr>
 <td>Name :</td>
 <td><input type="text" name="name" value="<?php echo $uname; ?>" /></td></tr>
 </tr>
 <tr>
 <td>Link :</td>
 <td><input type="text" name="link" value="<?php echo $ulink; ?>" /></td></tr>
 </tr>
 <tr>
 <td>Order :</td>
 <td><input type="text" name="order" value="<?php echo $uorder; ?>" /></td></tr>
 </tr>
 <tr>
 <td>Description :</td>
 <td><textarea name="description" rows="3" cols="50"> <?php echo $udescription; ?></textarea></td></tr>
 </tr>
 <tr>
 <td>Open in new window :</td>
 <td><input type="checkbox" name="openwindow" value="<?php echo $uopenwindow; ?>" <?php echo ($uopenwindow == 1 ? 'checked' : '') ?> /></td></tr>
 </tr>
 
 <td><input type="submit" name="Update" value="update" align="middle"/>
 <a href="admin.php?page=admin_linkesmenu" style="text-decoration:none;"><input type="button" name="cancel" value="Cancel" id="html-upload" align="middle"></a>
 </td>
 </tr>

</table>
</form>

<?php }elseif(isset($_GET['action']) && ($_GET['action'] == 'add'))
{ ?>
<hr>
<form name="add" action="" method="post">
 <table cellpadding="5" cellspacing="5">
 <tr>
 <td>Name :</td>
 <td><input type="text" name="name" /></td></tr>
 </tr>
 <tr>
 <td>Link :</td>
 <td><input type="text" name="link" /></td></tr>
 </tr>
 <tr>
 <td>Order :</td>
 <td><input type="text" name="order" /></td></tr>
 </tr>
 <tr>
 <td>Description :</td>
 <td><textarea name="description" rows="3" cols="50"></textarea></td></tr>
 </tr>
 <tr>
 <td>Open in new window :</td>
 <td><input type="checkbox" name="openwindow" value="1" /></td></tr>
 </tr>
 <tr>
 <td>
 <input type="submit" name="add" value="Add" align="middle"/>
 <a href="admin.php?page=admin_linkesmenu" style="text-decoration:none;"><input type="button" name="cancel" value="Cancel" id="html-upload" align="middle"></a>
 </td>
 </tr>
 
 </table>
</form>
 
<?php } else { ?>
<?php if($_GET['msg'] == 1) { ?>
<h2><center> Record Sucessfull Added</center></h2>
<?php } ?>

<?php if($_GET['msg'] == 2) { ?>
<h2><center> Record Sucessfull Updated</center></h2>
<?php } ?>

<?php if ($_GET['mag'] == 3){?>
<h2><center> Record Sucessfull Deleted</center></h2>
<?php } ?>

<div class="wrap" style="float:none;">
 <h2>Simple CRUD Operation
 <a class="add-new-h2" href="admin.php?page=admin_linkesmenu&action=add">Add New</a></h2>
</div>

<table cellspacing="0" class="wp-list-table widefat fixed pages">
 <thead>
 <tr>
 <th style="width:30px;" class="" id="" scope="col"><span>No</span></th>
 <th style="width:100px;" class="" id="" scope="col"><span>Name</span></th>
 <th style="width:100px;" class="" id="" scope="col"><span>Link</span></th>
 <th style="width:100px;" class="" id="" scope="col"><span>Order</span></th>
 <th style="width:200px;" class="" id="" scope="col"><span>Description</span></th>
 <th style="width:200px;" class="" id="" scope="col"><span>OpenWindow</span></th>
 <th style="width:200px;" class="" id="" scope="col"><span></span></th>
 </tr>
 </thead>
 <tbody id="the-list">
<?php
 $i = 1;
 $sqlg = "SELECT * FROM wp_crud_links ";
 //$resg = $wpdb->get_results($sqlg);
 //foreach ( $resg as $rowg ) 
 $resg = mysql_query($sqlg);
 
 if($resg === FALSE) { 
 die(mysql_error());
 }

 
 while($rowg = mysql_fetch_array($resg))
 { 
 $FileUpload=$rowg['FileUpload'];
 $rid=$rowg['ID'];
 
 echo '<tr valign="top">';
 echo '<td>'.$i.'</td>';
 echo '<td>'.$rowg['Name'].'</td>';
 echo '<td>'.$rowg['Link'].'</td>'; 
 echo '<td>'.$rowg['LinkOrder'].'</td>';
 echo '<td>'.$rowg['Description'].'</td>';
 echo '<td><input type="checkbox" '.($rowg['OpenWindow'] == 1?'checked':'').'/></td>';
 echo '<td><a href="admin.php?page=admin_linkesmenu&action=edit&id='.$rid.'" >Edit</a>&nbsp;||&nbsp;<a href="admin.php?page=admin_linkesmenu&action=delete&id='.$rid.'" onclick="javascript:return confirm(\'Are You Sure?\')">Delete</a></td>';
 echo '</tr>';
 $i++;
 } 
?>
 </tbody>
</table>
<?php } ?>
  • let’s create the front  end to display the data from the DB
  • public php in wp is done via shortcodes
  • private function define_public_hooks() add new line
  • $this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' );

 

  • this will call register_shortcodes function in the public folder of the plugin
  • public function register_shortcodes() {
        add_shortcode( 'crud_links_operation', array( $this, 'shortcode_crud_links_operation' ) );
    }
    
  • this will call shortcode_crud_links_operation that will generate html to display in the shortcode
  • after we create the shortcode we can insert it to a post or or page
  • [crud_links_operation][/crud_links_operation] and go to wp post and she the html you inserted in the short code.

 

 

Click here to browse more then 120 open source platforms:

https://bitnami.com/stacks

All what you will ever need is here:
  1. Social Networking
  2. CMS
  3. Bug Tracking
  4. Project Management
  5. Accounting
  6. Analytic
  7. application Server
  8. Business process management
  9. Blog
  10. chat
  11. ECM
  12. E-Commerce
  13. ELearning
  14. EMail
  15. ERP
  16. Forum
  17. And many many many more to come…
Bitnami is an app store for server software. Install your favorite applications in your own servers or run them in the cloud. Select one app to get started or learn more about what makes Bitnami special.  

Keywords

Bitnami, OpenSource, Open source, Catalog apps, Application catalog, JasperReport, Jasper

Learn how to develop WordPress Plugins

01  – Under <Wordpress-directory>wp-contentPlugins create a directory with the Plugin Name.

02 – There create a file <Plugin Name>.php

03 – Under WordPress plugins page the new plugin will be shown.

04 – Copy and paste the HelloWorld example below to <Plugin Name>.php file.

05 – Activate the Plugin from Plugins page.

06 – Your first plugin runs and displays “Hello World” at the top of WordPress admin area.

Example 1 - Hello World:
<?php
/**
* Plugin Name: HelloWorld
* Plugin URI: http://www.flash-jet.com
* Description: HelloWorld Example
* Version: 1.5
* Author: Gabriel Magen
* Author URI: http://www.flash-jet.com
* License: A "Slug" license name e.g. GPL12
**/

function hello_world()
{ 
    echo '<hr><b><center>Hello World !!!!!!!<hr>'; 
}

add_action("admin_head","hello_world");
?>

Read more about plugin development here: https://developer.wordpress.org/